I have 2 seperate python.exe, one is 64bit one is 32bit. The 64bit is the default one. How can I use subprocess or sys (or any relevant package) to switch control during mid-execution from the 64 bit to the 32 bit, execute code only for the 32 bit, then switch control back to the 64bit version? In other words, I'm looking for something like...
if struct.calcsize("P")==8: # check if 64 bit version
# switch to 32 bit version
# ??? new_shell = subprocess.Popen(location of 32 bit python.exe)??? what would go here
# pass a bunch of commands and then switch control back
# to the 64 bit version
Also, I'm using anaconda, so I imagine the first call will be for switching to the 32bit python.exe environment? During the 32bit process, some packages need to be imported and data will be returned at the end.
解决方案
Mid-exec