Skip to content

Instantly share code, notes, and snippets.

@FRidh
Created May 13, 2018 10:35
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 FRidh/c70d67e5ccbeb0b19e0c0d1eb59627dc to your computer and use it in GitHub Desktop.
Save FRidh/c70d67e5ccbeb0b19e0c0d1eb59627dc to your computer and use it in GitHub Desktop.
import os
import subprocess
os.environ["FOO"] = "BAR"
subprocess.run("python3 -c 'import os; print(os.environ.get(\"FOO\", \"\"))'", shell=True)
del os.environ["FOO"]
subprocess.run("python3 -c 'import os; print(os.environ.get(\"FOO\", \"\"))'", shell=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment