how to copy files from once location to another without using shutil in python -


i tried shutil python debugger throwing error..can know why this?? , there other way??

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) 

update:

getting error :

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 open(src, 'rb') fsrc:      ioerror: [errno 13] permission denied: 'c:\\program files (x86)\\agilent\\n2x\\quicktest\\scripts\\r 

using shutil is proper way achieve want, should understand why fails rather search alternative.

you traceback shows:

ioerror: [errno 13] permission denied: 'c:\\program files (x86)\\agilent\\n2x\\quicktest\\scripts\\r 

using alternative copying method won't able fix permission issue. stated torxed in answer, running under windows 7 program files directory under restrictive permissions.

on side note, should consider using raw strings paths containing backslashes prefixing literals r:

path = r"c:\program files (x86)" 

Comments

Popular posts from this blog

jquery - How can I dynamically add a browser tab? -

node.js - Getting the socket id,user id pair of a logged in user(s) -

keyboard - C++ GetAsyncKeyState alternative -