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