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 :)

1
  • 1
    Are we not reading the same docs? :data may be a string specifying additional data to send to the server, or None if no such data is needed. Commented Oct 24, 2010 at 22:14

2 Answers 2

8

You use the parameter names:

urlopen('http://www.exmaple.com/', timeout=5)
Sign up to request clarification or add additional context in comments.

1 Comment

excellent, thank you. makes it very readable with named params
1
urlopen('http://www.example.com/',timeout=5)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.