However, all the text that is of interest to you should still be there to check for curse words. The extra characters are hidden characters that Word as a program uses to format and manage your doc file in Word.
If this works, you will likely find there is a lot more characters in the file when it is opened in Python than what you see when the same file is opened in Word. If it is Houston.docx, then try: open("/Users/AquaAurelius/Documents/Home/Programming/Houston.docx") extension is Houston.doc, then try: open("/Users/AquaAurelius/Documents/Home/Programming/Houston.doc") Putting these two considerations together, I suggest try the following - refining salomonderossi solution. In the information box that opens, look at the top to see the name of the file (Houston) and the file extension of your file. If they are not visible, click once on your target file in OSX to select it, then press Command and the letter "I" key (together) for the information of this file. pdf)ĭepending on your OSX Finder preference settings, file extensions may not be visible to you. docx, unless when you saved the file in Word deliberately to another type of file (eg. Secondly if the file you are seeking to open is a Word doc file, the correct file name needs to include the correct file type extension. From my reading I understand your file name is Houston, and the folder it is in is called Programming. Understand that I am new to Python also.įirst I think in the above solutions the assumption is that your Word doc file is in a folder Houston.