Of course you can:
with open('yyy.mp4', 'wb') as f: f.write(open('xxx.mp4', 'rb').read())
Pay attention to the binary mode flag ( b ), since you are copying the contents of mp4 , you do not want python to re-interpret newlines for you.
It will take a lot of memory if xxx.mp4 is large. Take a look at the shutil.copyfile function for more efficient use of memory:
import shutil shutil.copyfile('xxx.mp4', 'yyy.mp4')
source share