realpython / book1-exercises

Book 1 -- Exercises for the book
160 stars 144 forks source link

11-1.py #25

Open patrickluvsoj opened 6 years ago

patrickluvsoj commented 6 years ago

Text needs to be encoded by Unicode to write to .txt file ==> pdf_txt.encode("utf-8"). Otherwise I get following error.

Traceback (most recent call last): File "/Users/xamarind/Documents/pdf_reader.py", line 20, in output_txt_file.write(pdf_txt) TypeError: write() argument must be str, not bytes