auto generate date path

This commit is contained in:
赵敬皓 2022-11-09 10:51:11 +08:00
parent ffdebde177
commit a7f122b623
1 changed files with 4 additions and 3 deletions

View File

@ -21,8 +21,8 @@ if __name__ == "__main__":
ftp.Login('jh_zhao_asagi.waseda.jp', 'SP+wari8') ftp.Login('jh_zhao_asagi.waseda.jp', 'SP+wari8')
# 从目标路径ftp_filePath将文件下载至本地路径dst_filePath # 从目标路径ftp_filePath将文件下载至本地路径dst_filePath
dst_filePath = './data' dst_filePath_root = './data'
dst_filePath = dst_filePath + "/" + dt.datetime.strftime(today, '%Y-%m-%d') dst_filePath = dst_filePath_root + "/" + dt.datetime.strftime(today, '%Y-%m-%d')
if not os.path.exists(dst_filePath): if not os.path.exists(dst_filePath):
os.makedirs(dst_filePath) os.makedirs(dst_filePath)
@ -85,6 +85,7 @@ if __name__ == "__main__":
_hourStr = [f"0{x}" if x < 10 else str(x) for x in range(23)] _hourStr = [f"0{x}" if x < 10 else str(x) for x in range(23)]
_yearStr, _monStr, _dayStr = Daod.getDateStr(_yearNum, _monNum, _dayNum) _yearStr, _monStr, _dayStr = Daod.getDateStr(_yearNum, _monNum, _dayNum)
ftp_filePath = "/pub/himawari/L2/PAR/020" + "/" + _yearStr + _monStr + "/" + _dayStr + "/" ftp_filePath = "/pub/himawari/L2/PAR/020" + "/" + _yearStr + _monStr + "/" + _dayStr + "/"
dst_filePath = dst_filePath_root + "/" + dt.datetime.strftime(today, '%Y-%m-%d')
Download_Path = dst_filePath + "/PAR_Minutes_Download" Download_Path = dst_filePath + "/PAR_Minutes_Download"
if not os.path.exists(Download_Path): if not os.path.exists(Download_Path):
os.makedirs(Download_Path) os.makedirs(Download_Path)