title: Updating a Zendesk ticket using Python
body: <p>After looking (and not finding) any example of updating a ticket in Zendesk using Python, I tried working from the cURL angle
  having the exampled cURL :</p>
  
  <pre><code>curl https://{subdomain}.zendesk.com/api/v2/tickets/{id}.json -H "Content-Type: application/json" -d '{"ticket": {"status": "open", "comment": { "body": "The smoke is very colorful.", "author_id": 494820284 }}}' -v -u {email_address}:{password} -X PUT
  </code></pre>
  
  <p>i gave it a few trials and got to a working example:</p>
  
  <pre><code>ticket_id = 'number'
  output_string = somestring
  user = '&lt;user&gt;'
  pwd = '&lt;pw&gt;'
  url = 'https://{subdomain}.zendesk.com/api/v2/tickets/' + ticket_id + '.json'
  cr_data = '{"ticket": {"status": "pending", "comment": { "body": "' + output_string + '", "author_id": 494820284 }}}'
  
  response = requests.put(url, headers=headers, data=cr_data, auth=(user, pwd))
  </code></pre>
  
  <p>thought it would be a good example for all who seek something like that.</p>