python - How to open html file? -


i have html file called test.html has 1 word בדיקה.

i open test.html , print it's content using block of code:

file = open("test.html", "r") print file.read() 

but prints ??????, why happened , how fix it?

btw. when open text file works good.

edit: i'd tried this:

>>> import codecs >>> f = codecs.open("test.html",'r') >>> print f.read() ????? 

import codecs f=codecs.open("test.html", 'r') print f.read() 

try this.


Comments

Popular posts from this blog

c++ - OpenMP unpredictable overhead -

ruby on rails - RuntimeError: Circular dependency detected while autoloading constant - ActiveAdmin.register Role -

javascript - Wordpress slider, not displayed 100% width -