]> git.saurik.com Git - wxWidgets.git/blob - wxPython/wxPython/lib/PyCrust/PyShell.py
0fea2d5d104661960028764272712281b8ed992e
[wxWidgets.git] / wxPython / wxPython / lib / PyCrust / PyShell.py
1 #!/usr/bin/env python
2 """PyShell is a python shell application."""
3
4 __author__ = "Patrick K. O'Brien <pobrien@orbtech.com>"
5 __cvsid__ = "$Id$"
6 __date__ = "July 1, 2001"
7 __version__ = "$Revision$"[11:-2]
8
9 from wxPython.wx import *
10 from shell import ShellFrame
11
12
13 class App(wxApp):
14 """PyShell standalone application."""
15
16 def OnInit(self):
17 locals = {'__app__': 'PyShell Standalone Application'}
18 self.shellFrame = ShellFrame(locals=locals)
19 self.shellFrame.Show(true)
20 self.SetTopWindow(self.shellFrame)
21 # Add the application object to the sys module's namespace.
22 # This allows a shell user to do:
23 # >>> import sys
24 # >>> sys.application.whatever
25 import sys
26 sys.application = self
27 return true
28
29
30 def main():
31 application = App(0)
32 application.MainLoop()
33
34 if __name__ == '__main__':
35 main()
36