I want to pass PYTHONPATH as argument to python.exe just like i can do this in java:
java -classpath /somedir/some.jar;/anotherdir MyClass
so i'm looking for something like:
python -PYTHONPATH /somedir/pythonsrc;/anotherdir/pythonsrc mymodule.py
is it possible to do such a think in python? thanks
Try to set the environement variable PYTHONPATH before launching python :
On windows :
set PYTHONPATH=/somedir/pythonsrc;/anotherdir/pythonsrc && python.exe mymodule.py
On unix
PYTHONPATH=/somedir/pythonsrc:/anotherdir/pythonsrc python mymodule.py
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