我只是在用shutil.copyfile文件要将.csv从网络路径复制到本地路径,请执行以下操作:
from shutil import copyfile
import os.path
import _datetime as dt
fileCsv = "VDOCUMENT.csv"
srcPath = r"\\reports\"
dstPath = r"C:\Audit1\"
copyfile(os.path.join(srcPath, fileCsv), os.path.join(dstPath, fileCsv))
Traceback (most recent call last):
File "C:/Users/cvmsouz/Desktop/test/00_MoveCSV.py", line 16, in <module>
copyfile(os.path.join(srcPath, fileCsv), os.path.join(dstPath, fileCsv))
File "C:\Users\cvmsouz\AppData\Local\Continuum\Anaconda3\lib\shutil.py", line 120, in copyfile
with open(src, 'rb') as fsrc:
FileNotFoundError: [Errno 2] No such file or directory: '\\\\reports\\VDOCUMENT.csv'
这个问题实际上是愚蠢的:网络文件与本地文件的名称不同。你知道吗
如果有什么东西可以学习,因为它对每个人都有好处,那就是为人们创造标准。你知道吗
相关问题 更多 >
编程相关推荐