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

@ -17,12 +17,12 @@ if __name__ == "__main__":
# 传入的YesdayNum在下载日数据时昨天的会需要
ftp = Daod.myFTP(host='ftp.ptree.jaxa.jp', YesdayNum=_dayNum - 1)
# 传入用户名和密码,可以自行注册并修改
# 传入用户名和密码,可以自行注册并修改
ftp.Login('jh_zhao_asagi.waseda.jp', 'SP+wari8')
# 从目标路径ftp_filePath将文件下载至本地路径dst_filePath
dst_filePath = './data'
dst_filePath = dst_filePath + "/" + dt.datetime.strftime(today, '%Y-%m-%d')
dst_filePath_root = './data'
dst_filePath = dst_filePath_root + "/" + dt.datetime.strftime(today, '%Y-%m-%d')
if not os.path.exists(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)]
_yearStr, _monStr, _dayStr = Daod.getDateStr(_yearNum, _monNum, _dayNum)
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"
if not os.path.exists(Download_Path):
os.makedirs(Download_Path)