I wanna do this:
import subprocess
subprocess.call(['var="foo_bar"'], shell=True)
subprocess.call(['echo $var'], shell=True)
But when i will use the $var in the second line your value is losted.
Somebody know some say to solve this problem? This is a simple example, but a need to do that in a much more complex code here..
Tks..
Inject the value into the environment with os.environ
.
os.environ['var'] = "foo_bar"
subprocess.call(['echo $var'], shell=True)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With