Advertisement

Python Embedding Multithreaded App

Started by January 29, 2005 09:51 AM
0 comments, last by Kylotan 19 years, 7 months ago
OK, I want a command window to type and edit things in my game. I can not for the life of me find any documentation on this. Anywhay, I have an app that looks like this:

int main(int argc, char *argv[])
{
  PythonLib* lib = new PythonLib(); //exposed library to python
  lib->m_test = 49;

  Py_Initialize();

  PyRun_InteractiveLoop(stdin, "<stdin>");

  Py_Finalize();
  return 0;
}

When I run PyRun_InteractiveLoop this gives me the command line I was wanting, but I can't import my library, I can't edit m_test, the value is 49, I want to change that in the python intrepreter. Any clues why I can't??? Thanks Jeff
That's not enough information. What is PythonLib and how is it exposed? What exactly are you trying to import, and how? And doesn't any sort of binding have to take place after Py_Initialize rather than before?

This topic is closed to new replies.

Advertisement