Skip to content

Instantly share code, notes, and snippets.

@rickcnagy
Last active December 19, 2015 13:29
Show Gist options
  • Save rickcnagy/5962381 to your computer and use it in GitHub Desktop.
Save rickcnagy/5962381 to your computer and use it in GitHub Desktop.
Read the passwords saved to disk in setup.py
class Passwords(object):
def __init__(self):
try:
passwords = cPickle.load(open("passwords.p"))
except (EOFError, IOError):
sys.exit("No password file (./passwords.p) found. Please run 'setup.py'.")
self.USERNAME = passwords['USERNAME']
self.PASSWORD = passwords['PASSWORD']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment