简体   繁体   中英

Can you call .py(32bit) from .py(64bit)

Can I execute a 32bit python file from within a 64bit python file?

I use Teradata which relies on a 32bit infrastructure. This is why whenever I need to query data I use python 32bit with teradata module to pull my data. This is in one file called a.py.

The trouble is that the rows of data is too much for my 32bit python to handle as I keep getting memory issues. Thus the need for 64bit version.

import subprocess
subprocess.call(['python', 'a.py'])

I want to be able to run a.py from within my 64bit version and save the data in a dataframe df. Is this possible?

Help much appreciated.

There's no such thing as a 32-bit or 64-bit Python file. Python scripts do not have a specific architecture associated with them. They are compiled at runtime on the machine. If your OS is 64-bit, the data addressing is also 64-bit. If your OS is 32-bit, the data addressing will be 32-bit.

There is no real problem with calling Python scripts from another Python script. However, if you're asking whether calling the script using the 64-bit Python installation will open the subprocess in a 32-bit environment, the answer is no. I suggest that you install the 64-bit driver for Teradata instead and just run everything from a single script.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM