[我有一个文件夹,每当上传.dat
文件时,我都会在其中获得.csv
文件。
所以,我想检查特定位置是否存在.dat
文件,如果该位置存在,那么我才想使用python和boto3将文件上传到s3。
有人可以帮我吗?
尝试以下操作:
import os
path_to_your_file = ''
if os.path.isfile(path_to_your_file):
print('File exists')
else:
print("File doesn't exist")