calling Python script from another Python script (Windows, multiple installation problem)

Martin Landa landa.martin at gmail.com
Wed Mar 26 05:40:13 EDT 2014


Hi all,

I am trying to fix a bug in the project which I am working for. The program starts on Windows via bat file which calls a Python script to set up the environment including GUI and allow to launch program-specific tools. Some of the tools are written in C, some in Python. These commands are run via subprocess.Popen class. The Windows installer comes with its own bundled Python which is usually different from possible system-wide Python. This is source of the problems, Python scripts run via subprocess.Popen are launched via system-wide Python version, not desired bundled Python. Except hacks like `Popen(sys.executable, ...)` I am looking for a better solution. I checked virtualenv [1] or Pylauncher [2] but without success, speaking about Python2 not Python3 which comes from version 3.3 with intergrated pylauncher...

Thanks in advance for any ideas, suggestions or pointers! Martin

[1] http://www.virtualenv.org/en/latest/
[2] https://bitbucket.org/vinay.sajip/pylauncher



More information about the Python-list mailing list