#!/usr/bin/env python3
# 10240 = 10kB
def main():
img_in = open('foto.jpg','rb')
img_out = open('foto-copy.jpg','wb')
while True:
buff = img_in.read(10240)
if buff:
img_out.write(buff)
print('.',end='',flush=True)
else: break
img_in.close()
img_out.close()
print('\nCopied.')
if __name__ == '__main__': main()
Duplicate image file using python
Be the first to comment
You can use [html][/html], [css][/css], [php][/php] and more to embed the code. Urls are automatically hyperlinked. Line breaks and paragraphs are automatically generated.