Enk
November 21st, 2009, 11:13 PM
Hi
I am currently working on a little hobby project in C++, but wants to move some of the code to a scripted language.
I've used some Python and really like it so it was an obvious choice :)
I found this (http://www.codeproject.com/KB/cpp/embedpython_1.aspx) article on codeproject.com, but this doesn't work with 2.6.
I'm getting an "ImportError: Import by filename is not supported." at the PyImport_Import()-function since 2.6 doesn't allow loading of modules this way.
So how can I load python scripts in C++?
I am currently working on a little hobby project in C++, but wants to move some of the code to a scripted language.
I've used some Python and really like it so it was an obvious choice :)
I found this (http://www.codeproject.com/KB/cpp/embedpython_1.aspx) article on codeproject.com, but this doesn't work with 2.6.
I'm getting an "ImportError: Import by filename is not supported." at the PyImport_Import()-function since 2.6 doesn't allow loading of modules this way.
So how can I load python scripts in C++?