I want to use a wxPyShell from a splitter window to have an interactive
python area on my gui. However I want this shell to be able to access the
namespace of the currently running gui, i.e. I want to be able to browse
through all my global data variables as well as the gui objects themselves.
Is this possible? I haven't had much luck at accessing the global and gui
namespaces. - Kevin
I want to use a wxPyShell from a splitter window to have an interactive
python area on my gui. However I want this shell to be able to access the
namespace of the currently running gui, i.e. I want to be able to browse
through all my global data variables as well as the gui objects
themselves.
Is this possible? I haven't had much luck at accessing the global and gui
namespaces.
Whatever you put in the dictionary you pass as the globals parameter is the
namespace that is seen by the PyShell. For example:
g = {'hello' : 'How are you?',
'frame' : self,
'wx' : wxPython.wx,
}
win = PyShell(self, globals=g)
When the PyShell starts up then there will be three objects in its namespace
to begin with, a string named hello, the parent window named frame, and a
module named wx.
I have this running and am able to access both the global and local
namespace. I don't have access to my code right now, but what I do is just
catch the event in my frame and exec it. Hope you get some better help
from someone else. If you don't, I should be able to access my stuff in
about a week...
Good Luck,
Leo.
···
On Mon, 25 Sep 2000, Kevin A. White wrote:
I want to use a wxPyShell from a splitter window to have an interactive
python area on my gui. However I want this shell to be able to access the
namespace of the currently running gui, i.e. I want to be able to browse
through all my global data variables as well as the gui objects themselves.
Is this possible? I haven't had much luck at accessing the global and gui
namespaces. - Kevin