And was there anythin special to include sys???
At least if you wanted a nice grib on the file operation. include os.
also you could simply use ....
with open(filename,"w") as opfile:
opfile.write(foo.decode('utf8')
or use
with open(os.chmod(os.path.realpath(filename),0777),'w'):
to get super control over the created file.
in the end....
import urllib
import webbrowser
import os
#'http://www.imdb.com/list/SuSZdwCyHzU/'
def savePage(urll,filename):
page=urllib.urlopen(urll).read()
print(page)
##sys.argv[0]=filename
with open(os.chmod(os.path.realpath(filename),0777),'w') as outfile:
outfile.write(page.decode('utf8'))
savePage('http://www.daniweb.com/software-development/python/threads/406620/1735920#post1735920','outIMDB.html')
webbrowser.open('outIMDB