Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Python: Python

PyImport_ImportModule("foo.bar")

 

 

Python python RSS feed   Index | Next | Previous | View Threaded


sndive at gmail

Dec 6, 2007, 6:22 PM

Post #1 of 1 (67 views)
Permalink
PyImport_ImportModule("foo.bar")

I'm trying to import foo.bar in order not to add every single
directory with python files to the search path.
i immediately follow the import with the PyModule_AddObject call to
put the imported module
to __main__ module
but later on PyEval_EvalCode on Py_CompileString compiled code
"foo.bar.baz()" and dictionary of __main__
used for global and local context does not work (I get NameError).

is there an equivalent of import foo.bar as Bar; in c api
or should i call into submodules differently?
--
http://mail.python.org/mailman/listinfo/python-list

Python python RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.