Advertisement
Rendier

file copy without import

Jun 13th, 2021 (edited)
450
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.15 KB | None | 0 0
  1. with open('/home/directory/filename.jpg', 'rb') as file:
  2.     newfile = open("/home/otherdirectory/newfile.jpg", 'wb')
  3.     newfile.write(file.read())
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement