Opening file with urllib
Jon Cosby
jcosby at wolfenet.com
Fri Oct 27 12:36:11 EDT 2000
More information about the Python-list mailing list
Fri Oct 27 12:36:11 EDT 2000
- Previous message (by thread): Opening file with urllib
- Next message (by thread): [Numpy-discussion] Re: numpy, overflow, inf, ieee, and rich comparison
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
I'm writing a simple CGI script using urllib to open a file. When I run the
script, I'm getting an error message "Unterminated string constant." The
problem seems to be in the urlopen() method; when I use the open() method in
the local path, the script runs as expected. The suspect code is as follows:
def GetLink():
InFile = urllib.urlopen("http://computer/cgi-bin/Links.txt")
List = InFile.readlines()
Link = whrandom.choice(List)
InFile.close()
return Link[:-1]
I see that the data arguments aren't required, but what else could it be?
I'm stumped. If ayone sees what I'm missing, please contact me at
jcosby at wolfenet.com
Jon Cosby
- Previous message (by thread): Opening file with urllib
- Next message (by thread): [Numpy-discussion] Re: numpy, overflow, inf, ieee, and rich comparison
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the Python-list mailing list