Я пытаюсь изменить файл из одного места в другое.
Вот код:
print ("Loading system, please wait 5 seconds.")
try:
import os, sys
# Path to be created
path = "C:\Windows2" # Just a testing random file...
os.mkdir( path, 0755 );
except:
print 'Path already created. Passing...'
import shutil
src = data_path = os.path.expanduser('~')+ '\Desktop\admin.dll'
dst = data_path = "C:\Windows2"
shutil.move(src, dst)
Но тогда я получаю следующую ошибку:
Traceback (most recent call last):
File "C:\Users\youse\Desktop\TESTING.py", line 16, in <module>
shutil.move(src, dst)
File "C:\Python27\lib\shutil.py", line 316, in move
copy2(src, real_dst)
File "C:\Python27\lib\shutil.py", line 144, in copy2
copyfile(src, dst)
File "C:\Python27\lib\shutil.py", line 96, in copyfile
with open(src, 'rb') as fsrc:
IOError: [Errno 22] invalid mode ('rb') or filename: 'C:\\Users\\youse\\Desktop\x07dmin.dll'
>>>