title: Saving json response in python
body: <p>I am using this code do get information from my website with python, and this works like a charm, but can i save this output to a variable or at least to a json or txt file</p>
  
  <pre><code>import pycurl
  def getUserData():
     c = pycurl.Curl()
     c.setopt(pycurl.URL, 'https://api.github.com/users/braitsch')
     c.setopt(pycurl.HTTPHEADER, ['Accept: application/json'])
     c.setopt(pycurl.VERBOSE, 0)
     c.setopt(pycurl.USERPWD, 'username:userpass')
     c.perform()
  getUserData()
  </code></pre>