简体   繁体   中英

Value Pass from Python to EXE

Actually I create ".exe" file using C++ that takes 1 value as input and calculate the result. Now i want to pass the value form a python program to the ".exe" directly. Is is actually possible??

One thing you can do is output the python program to a file. From the console it looks like:

$ python script.py > output

or you can do it in Python by redirecting stdout to file:

import sys
sys.stdout = open('output', 'w')

Then you can use the output file as input to your exe.

$ program.exe output

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