我尝试使用shutil但python调试器抛出错误..我能知道这是为什么吗?还有其他方法吗?
path = "C:\\Program Files (x86)"
if os.path.exists(path):
src= "C:\\Program Files (x86)\\abc\\xyz\\QuickTest\\Scripts\\RouterTester900\\Diagnostic\\RouterTester900SystemTest"
else:
src= "C:\\Program Files\\abc\\xyz\\QuickTest\\Scripts\\RouterTester900\\Diagnostic\\RouterTester900SystemTest"
dest = "C:\\Sanity_Automation\\"
shutil.copy(src,dest)
更新:
收到此错误:
Traceback (most recent call last):
File "C:\Sanity_Automation\Work_Project\copy.py", line 15, in <module>
shutil.copy(src, dest)
File "C:\Sanity_Automation\Python272\lib\shutil.py", line 116, in copy
copyfile(src, dst)
File "C:\Sanity_Automation\Python272\lib\shutil.py", line 81, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 13] Permission denied: 'C:\\Program Files (x86)\\Agilent\\N2X\\QuickTest\\Scripts\\R