Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
タイムアウトを設定する必要がありurllib2.request()ます。
urllib2.request()
のパラメータをurllib2.urlopen()使用しているので使用しません。どうすればこれを設定できますか?datarequest
urllib2.urlopen()
data
request
それでも、urlopen の使用を避けて、次のように進めることができます。
request = urllib2.Request('http://example.com') response = opener.open(request,timeout=4) response_result = response.read()
これも機能します:)