Python - Example of urllib2 asynchronous / threaded request using HTTPS
问题 I'm having a heck of a time getting asynchronous / threaded HTTPS requests to work using Python's urllib2. Does anyone out there have a basic example that implements urllib2.Request, urllib2.build_opener and a subclass of urllib2.HTTPSHandler? Thanks! 回答1: The code below does 7 http requests asynchronously at the same time. It does not use threads, instead it uses asynchronous networking with the twisted library. from twisted.web import client from twisted.internet import reactor, defer urls