In article <mailman.133.1250270175.2903.python-l...@python.org>, Chris Withers <ch...@simplistix.co.uk> wrote: >Aahz wrote: >> >> What do you need to know for a decent example? > >Simple download of a file from a url with some auth headers added would >do me.
Well, I've hacked up some sample code from my company's codebase: # !!! UNTESTED !!! c = pycurl.Curl() c.setopt(pycurl.URL, url) c.setopt(pycurl.USERPWD, "%s:%s" % (user, pwd)) c.setopt(pycurl.FOLLOWLOCATION, 1) c.setopt(pycurl.MAXREDIRS, 5) c.setopt(pycurl.CONNECTTIMEOUT, 30) f = StringIO() c.setopt(pycurl.WRITEDATA, f) c.perform() c.close() -- Aahz (a...@pythoncraft.com) <*> http://www.pythoncraft.com/ "Given that C++ has pointers and typecasts, it's really hard to have a serious conversation about type safety with a C++ programmer and keep a straight face. It's kind of like having a guy who juggles chainsaws wearing body armor arguing with a guy who juggles rubber chickens wearing a T-shirt about who's in more danger." --Roy Smith -- http://mail.python.org/mailman/listinfo/python-list