Skip to main content
GameDev.net gamedev.net
🔒 Locked

Python Help

Started by Robinhood Aug 30, 2006 at 3:39 AM 1 replies 1k views
Original Post
Robinhood
Robinhood
My C++ test program "runs" a python script which is in a different file. Is there any way to get the value of the variables after python script finishes? My method is to save the result in a text file and then let the test program fetch the result from the file.However,I think that is a bad way to do that.
bubu LV
bubu LV
You could print out these variables, and then parse them from standart output stream (similary how grep works).

Alternative way, which would allow you to get variable values directly from memory would be embedding python interpretator into your program. It means that your programm would be able to parse and execute python scripts without invoking external commands. See python manual how to do it (it has examples).

Another approach would be communicating throu sockets or some other IPC (inter process communication) means.

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.