working with pdf and word documents pdf and word documents are binary fileswhich makes them much more complex than plaintext files in addition to textthey store lots of fontcolorand layout information if you want your programs to read or write to pdfs or word documentsyou'll need to do more than simply pass their filenames to open(fortunatelythere are python modules that make it easy for you to interact with pdfs and word documents this will cover two such modulespypdf and python-docx pdf documents pdf stands for portable document format and uses the pdf file extension although pdfs support many featuresthis will focus on the two things you'll be doing most often with themreading text content from pdfs and crafting new pdfs from existing documents