Python 3. I\'m using QT\'s file dialog widget to save PDFs downloaded from the internet. I\'ve been reading the file using \'open\', and attempting to write it using the fil
It really doesn't make sense to write a file in another file. What you want is to write the contents of f1 in f2. You get the contents with f1.read(). So you have to do this:
with open('file_to_read.pdf', 'rb') as f1:
with open('file_to_save.pdf', 'wb') as f2:
f2.write(f1.read())