tags:

views:

76

answers:

2

Looking at the python doc http://docs.python.org/library/urllib2.html

urllib2.urlopen(url[, data][, timeout])

So, I pass in a url, then optional data and timeout variables (from how I read it).

So if I want to pass a timeout, but not the data... whats the default variable for data? Do you just do,

urlopen('http://www.example.com/', , 5)

Thanks :)

+8  A: 

You use the parameter names:

urlopen('http://www.exmaple.com/', timeout=5)
Adam Vandenberg
excellent, thank you. makes it very readable with named params
Wizzard
+1  A: 
urlopen('http://www.example.com/',timeout=5)
Steve