Skip to content

Instantly share code, notes, and snippets.

@harunyasar
Created January 18, 2016 11:59
Show Gist options
  • Save harunyasar/a5c5f16657947e50912d to your computer and use it in GitHub Desktop.
Save harunyasar/a5c5f16657947e50912d to your computer and use it in GitHub Desktop.
Python open file binary mode
import base64
file_data = base64.urlsafe_b64decode(pdf.encode('utf8'))
with open('pdf_name.pdf', 'wb') as file:
file.write(file_data)
return pdf
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment