Dec-08-2017, 05:00 PM
Quote: The question is that if the folder is html format then I cant open it at all.
Folders have no format.
A text file that happens to have the .html extension is still just a text file, and is the same as any .txt file (or .py file for that matter). You don't need to supply an encoding to
open()
to open an html file, unless the file is actually encoded in a special way (most of them are not, though).