Skip to content

Instantly share code, notes, and snippets.

@ijharulislam
Last active July 31, 2017 16:33
Show Gist options
  • Select an option

  • Save ijharulislam/2fe78d75fb95eb2120a129f845cdcf1a to your computer and use it in GitHub Desktop.

Select an option

Save ijharulislam/2fe78d75fb95eb2120a129f845cdcf1a to your computer and use it in GitHub Desktop.
import os
file = os.path.expanduser('~')+"/.bashrc"
environs = [
"DB_NAME=db",
"DB_USER=db_user",
"DB_PASSWORD=password",
"SECRET_KEY='your secret kye here'",
"DEBUG=False",
"EMAIL_HOST_PASSWORD=password",
]
with open(file, 'a') as f: # 'a' stands for "append"
for env in environs:
f.write("export {}\n".format(env))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment