[Tutor] Is it syntactic,semantic or runtime?

Sander Sweers sander.sweers at gmail.com
Sat Apr 25 12:10:20 CEST 2009


2009/4/25 prasad rao <prasadaraon50 at gmail.com>:

> So opening blank Explorer after complaining th html file not found.
> Where is the problem?

There are typing errors on the below...

> <code>
> def pp():
> @@@ import urllib
> @@@ import subprocess
> @@@ so=urllib.urlopen('http://www.asstr.org')
> @@@ data=so.read()
> @@@ de=open('C:pp.html','w')

This create a file pp.html in the directory where the script was run
from. I expect you want it in c:\ so it should look like. Notice the
backslash is escaped with a backslash!

  de = open('c:\\pp.html', 'w')

> @@@ de.write(data)
> @@@ subprocess.Popen(['C:\Program Files\Internet
> xplorer\\IEXPLORE','C:pp.html'])

Again the same issue as above plus the path to iexplore.exe is bad.

  subprocess.Popen(['C:\\Program Files\\Internet
Explorer\\iexplore.exe','C:\\pp.html'])

This works for me.

Greets
Sander


More information about the Tutor mailing list