Namespace problems

Kiran Kiran.Karra at gmail.com
Tue Jun 6 10:20:34 EDT 2006


Hello All,
  I am kind of a beginner to python, but here is the deal.

  I am writing a wxpython Application, in which I have a GUI.  This GUI
imports some other modules that I have written, using the format
import mymodule as _MyModule

  Now, this GUI in addition to having all it's bells and whistles has a
console (from pyshell), so that the user can run their own scripts
inside this GUI.
  What I am trying to do is to get these scripts that the user runs to
be able to see all the other objects created and modules imported by
the GUI.

  To make this clear, what I want to be able to do for example is in my
script, do ,
         dir(mymodule),
  already having imported mymodule in the GUI.
  Any ideas on how to make this happen?  I don't want to import
mymodule in this script, i want this script to see the mymodule that I
imported in the main GUI.

thanks a lot for your help,
Kiran




More information about the Python-list mailing list