Whats missing?

Andrew M. Kuchling akuchlin at mems-exchange.org
Tue Jun 1 13:33:17 EDT 1999


Daniel Faulkner writes:
>from urllib import urlopen
>Data = urlopen("http://www.python.org/").read()
>print Data
 ...
>        Data = urlopen('"' + UrlCurr + '"').read()

	 Why are you adding quotes here?  In the first example, you're 
passing the string 'http://www.python.org'; the double or single
quotes are just part of the language notation for a string literal.
UrlCurr is, I assume, already a string, so Data =
urlopen(UrlCurr).read() should work fine.

-- 
A.M. Kuchling			http://starship.python.net/crew/amk/
Luckily, every good story is allowed one astounding coincidence. The writer
has decided to cash his in now.
    -- In Phil Foglio's STANLEY AND HIS MONSTER #2




More information about the Python-list mailing list