/******************************************************************************\
Title:
Simple Python Interpreter
Description:
This is an example of a simple Python interpreter.
Note that you must copy python24.dll from the Dev-C++/DLL
to where this program will be built.
Author:
Rob Loach (http://www.robloach.net)
Date:
March 22, 2005
\******************************************************************************/
#include <iostream>
#include <string>
usingnamespace std;
/*
Include the Python library
*/
extern"C" {
#include <python2.4/Python.h>
}
int main(int argc, char* argv[])
{
/*
Initialize Python
*/
Py_Initialize();
/*
Display Python version information and some help
*/
cout << "Python " << Py_GetVersion() << endl << endl << endl;
cout << "Type in some Python script. Type 'exit' to quit." << endl;
/*
Start the interpreter
*/
string input;
while(input != "exit"){
cout << ">> ";
getline(cin, input);
PyRun_SimpleString(input.c_str());
}
/*
Finish up
*/
Py_Finalize(); // Close Python
return 0;
}
usherpp: justinzhang has only a single post, and it was in January. I don't think he's ever coming back. I'm afraid it was a waste of effort to bump this thread after a month and ten days of inactivity. Sorry, man...