[Tutor] Is it syntactic,semantic or runtime?
Kent Johnson
kent37 at tds.net
Sat Apr 25 13:45:51 CEST 2009
On Sat, Apr 25, 2009 at 5:38 AM, prasad rao <prasadaraon50 at gmail.com> wrote:
> hello
> I wrote a function to fetch data using urllib and displaying the data
> using internet Explorer.
> it is not preparing the html file
> So opening blank Explorer after complaining th html file not found.
> Where is the problem?
> Can I display the data read from a site without preparing
> a html file?
> <code>
> def pp():
> @@@ import urllib
> @@@ import subprocess
> @@@ so=urllib.urlopen('http://www.asstr.org')
> @@@ data=so.read()
> @@@ de=open('C:pp.html','w')
> @@@ de.write(data)
You should close de here so the file is flushed to disk:
de.close()
Kent
> @@@ subprocess.Popen(['C:\Program Files\Internet
> xplorer\\IEXPLORE','C:pp.html'])
>
> </CODE>
>
> prasad
> _______________________________________________
> Tutor maillist - Tutor at python.org
> http://mail.python.org/mailman/listinfo/tutor
>
>
More information about the Tutor
mailing list