Having opened a binary pdf file, I try to save it into a new file, open for writing binary. but instead of characters there are records like \ x00 \ x14QE \ x00 \ xa2 \ x8a. How to fix it.
f = open('1.pdf', 'rb') str_b = f.read() f.close() f2 = open('2.pdf', 'wb') f2.write(str_b) f2.close()
f2 = open ('2.pdf', wb), notf2 = open ('2.pdf', 'wb')? Yes, and how to open2.pdfto see records like \ x00 \ x14QE \ x00 \ xa2 \ x8a? - gil9red