PyImport_ImportModule and folders
![](https://secure.gravatar.com/avatar/40a5c50818708b27e5a2b670b83ef264.jpg?s=120&d=mm&r=g)
Hello.
I have a problem with importing a script in a folder. The script is in a folder simple\index.py. This folder is in the root folder of my application. I use boost 1.33.1 with Python 2.4.
Here is my code:
PyObject *pObject = PyImport_ImportModule(const_cast<char*>(pcSkriptName.c_str()));
If I use pcSkriptName with value "index" all works right. Now I want to load this script in the folder simple. But pcSkriptName with value "simple.index" doesn't work.
What shell I do?
Thanks for responding.
Psssst! Schon das coole Video vom GMX MultiMessenger gesehen? Der Eine für Alle: http://www.gmx.net/de/go/messenger03
![](https://secure.gravatar.com/avatar/06f67632bd8f7d257a9ee873f83c550a.jpg?s=120&d=mm&r=g)
2008/9/3 anti00Zero <anti00Zero@gmx.de>
Hello.
I have a problem with importing a script in a folder. The script is in a folder simple\index.py. This folder is in the root folder of my application. I use boost 1.33.1 with Python 2.4.
Here is my code:
PyObject *pObject = PyImport_ImportModule(const_cast<char*>(pcSkriptName.c_str()));
If I use pcSkriptName with value "index" all works right. Now I want to load this script in the folder simple. But pcSkriptName with value "simple.index" doesn't work.
What shell I do?
Silly question, but do you have an __init__.py file in the "simple" folder ?
Thanks for responding.
Psssst! Schon das coole Video vom GMX MultiMessenger gesehen? Der Eine für Alle: http://www.gmx.net/de/go/messenger03
capi-sig mailing list capi-sig@python.org http://mail.python.org/mailman/listinfo/capi-sig
-- Gustavo J. A. M. Carneiro INESC Porto, Telecommunications and Multimedia Unit "The universe is always one step beyond logic." -- Frank Herbert
participants (2)
-
anti00Zero
-
Gustavo Carneiro