WxPython questions.

Alex Martelli aleaxit at yahoo.com
Fri Jun 15 06:10:01 EDT 2001


"Omri Schwarz" <ocschwar at mit.edu> wrote in message
news:octofrqcedk.fsf at mint-square.mit.edu...
    ...
> So my question is, is there a more interactive way to
> play around with wxPython?

Sure!  Just remember that an EMPTY line typed to the
interactive interpreter tells the interpreter that
the compound-statement is finished, as witness the
change of prompt...:

> >>> class MyFrame(wxFrame):
> ...     def __init__(self, parent, ID, title):
> ...         wxFrame.__init__(self, parent, ID, title,
> ...                          wxDefaultPosition, wxSize(200, 150))
> ...         self.CreateStatusBar()
> ...         self.SetStatusText("This is the statusbar")
> ...

Here you presumably entered an empty line, and so...:

> >>>         menu = wxMenu()

...the def and class statements are finished, as evidenced
by the prompt being back to >>>.  Just avoid empty lines
except when you *ARE* finished with a compound statement!

It will be difficult to edit errors &c when working this
way.  I suggest you keep two texboxes/terminal-emulator
windows/commandboxes/dosboxes/whatever.  Use one to write
small textfiles with your editor of choice, the other to
hold the interactive session in the same directory, and
use Python function execfile to 'gobble' into the
interactive session the textfiles you're editing...


Alex






More information about the Python-list mailing list