after embedding and extending python (using swig) problem importing (non-core) modules

Donnie Leen kingdom.lin at yeah.net
Wed Dec 8 01:24:40 EST 2004


Du you use program in linux? I work in windows, but I think it's a way
to tell your program the module path like this:

char path[MAX_PATH], cpy_cmd[MAX_PATH];
GetCurrentDirectory( MAX_PATH, path );
sprintf( cpy_cmd, "sys.path.append(r\'%s\\modules\')", path );
PyRun_SimpleString("import sys");                // load build-in
module sys
    PyRun_SimpleString( cpy_cmd );		//	set my modules path




More information about the Python-list mailing list