Skip to content

Instantly share code, notes, and snippets.

@arthurbarros
Last active March 8, 2018 20:23
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 arthurbarros/fee99de8b064067969da564147c0ae1c to your computer and use it in GitHub Desktop.
Save arthurbarros/fee99de8b064067969da564147c0ae1c to your computer and use it in GitHub Desktop.
import json
whitelist = []
def add_user_whitelist(user_id):
whitelist.append(user_id)
add_user_whitelist(12345678000)
with open('local.txt', 'w') as file:
json_encoded = json.dumps(whitelist)
file.write(json_encoded)
import json
with open('local.txt', 'r') as file:
whitelist = json.loads(file.read())
print(whitelist) # [ 12345678000 ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment