Jan-09-2024, 02:20 PM
In my work environment, I have very little leeway with my the software configuration. I concurrently use two versions of python: a 2.xx version to access the API of another software and a 3.xx version for my personal developments.
I am developing a little software for myself and coworkers, and I'd like to keep the interface as simple as possible. My goal -- I'm starting to doubt it's feasible (let alone elegant...) -- is that the user can seamlessly write his custom script using functions relying on the 2.xx version (i.e. function relying on the external software) and functions for python 3.xx.
To make the matter a little more complicated, the 2.xx version needs to be invoked by the external software interpreter. The one thing that might save me is that the execution is quite sequential: pre-processing, processing and post-processing. Only the post-processing needs to be executed with python 3.xx.
So, if I had to reformulate my question, would anyone have an idea/suggestion how to write a script that will be executed by some python 2 interpreter, and at some point of the execution, will switch to another python (3) interpreter? The only avenue I can think of at the moment is to use a subprocess, but I don't think it fulfills all my requierements.
Thank you.
I am developing a little software for myself and coworkers, and I'd like to keep the interface as simple as possible. My goal -- I'm starting to doubt it's feasible (let alone elegant...) -- is that the user can seamlessly write his custom script using functions relying on the 2.xx version (i.e. function relying on the external software) and functions for python 3.xx.
To make the matter a little more complicated, the 2.xx version needs to be invoked by the external software interpreter. The one thing that might save me is that the execution is quite sequential: pre-processing, processing and post-processing. Only the post-processing needs to be executed with python 3.xx.
So, if I had to reformulate my question, would anyone have an idea/suggestion how to write a script that will be executed by some python 2 interpreter, and at some point of the execution, will switch to another python (3) interpreter? The only avenue I can think of at the moment is to use a subprocess, but I don't think it fulfills all my requierements.
Thank you.