<div dir="ltr"><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">doesn't exactly work for Python scripts, though:<br>

</blockquote><div><br>True, but you can use it in the following (admittedly messy) way:<br><br>jl> cat setenv.sh<br>/usr/bin/env python $@<br>. ./settmp<br>rm settmp<br><br>jl> cat env.py<br>#!/usr/bin/python<br>command = "export TEST='hello'\n"<br>
open('settmp', 'w').write(command)<br><br>jl> . setenv.sh env.py && env | grep TEST<br>
TEST=hello<br><br>Note this won't set the environment variable until the end of the script, so if it's used in the script as well then it'll also need to be set with, for example, os.environ["TEST"] = "hello"<br>
<br>John.<br> <br></div></div><br></div>