Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@IuryAlves
Created July 15, 2015 17:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save IuryAlves/07f3bfaed493cb10ed28 to your computer and use it in GitHub Desktop.
Save IuryAlves/07f3bfaed493cb10ed28 to your computer and use it in GitHub Desktop.
import json
# Apenas um exemplo de como fazemos
# jeito errado
with open('dados.json', 'w') as f:
f.write('{dados:' + json.dumps(['dados']) + '}')
# jeito certo
with open('dados.json', 'w') as f:
json.dump({'dados': ['dados']}, f)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment