Yes, I did. Here the link <a href="http://docs.python.org/extending/extending.html#providing-a-c-api-for-an-extension-module">http://docs.python.org/extending/extending.html#providing-a-c-api-for-an-extension-module</a><br>
<br>It does not cover .py file embeding. So it is not my case.<br><br><div class="gmail_quote">On Fri, Mar 4, 2011 at 7:03 PM, Santoso Wijaya <span dir="ltr"><<a href="mailto:santoso.wijaya@gmail.com">santoso.wijaya@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div>Have you read the doc [1] on extending/embedding Python?<br clear="all"></div><div><br>
</div>~/santa<br>
<div><br></div><div>[1] <a href="http://docs.python.org/extending/" target="_blank">http://docs.python.org/extending/</a><br></div><br><div class="gmail_quote">On Fri, Mar 4, 2011 at 8:27 AM, Arthur Mc Coy <span dir="ltr"><<a href="mailto:1984docmccoy@gmail.com" target="_blank">1984docmccoy@gmail.com</a>></span> wrote:<br>


<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">Hi all,<br>
<br>
<br>
I have a C++ application. I have a .cpp file which is not a main<br>
program, but a class where I want to call python script<br>
(doSomething.py file).<br>
<br>
I'm using embed python like in a tutorial here:<br>
<a href="http://www.codeproject.com/KB/cpp/embedpython_1.aspx" target="_blank">http://www.codeproject.com/KB/cpp/embedpython_1.aspx</a><br>
<br>
But the tutorial is bad. It does not explain howto create python<br>
module which they call in their example. doSomething.py file contains<br>
two classes, one of them I use externally (its functions).<br>
<br>
So I need to PyImport_Import(py_module) by name of this py file, but<br>
when I try to do that it fails. Please, give me some examples.<br>
<br>
<br>
If needed, I can attach my code as well.<br>
Thank you, waiting for anybody's response!<br>
Be happy.<br>
<br>
Arthur<br>
<font color="#888888">--<br>
<a href="http://mail.python.org/mailman/listinfo/python-list" target="_blank">http://mail.python.org/mailman/listinfo/python-list</a><br>
</font></blockquote></div><br>
</blockquote></div><br>