Python错误到simple copy.csv fi

2024-04-19 18:13:05 发布

您现在位置:Python中文网/ 问答频道 /正文

我只是在用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'

Tags: csvpathimport路径osasfilereports
1条回答
网友
1楼 · 发布于 2024-04-19 18:13:05

这个问题实际上是愚蠢的:网络文件与本地文件的名称不同。你知道吗

如果有什么东西可以学习,因为它对每个人都有好处,那就是为人们创造标准。你知道吗

相关问题 更多 >