[Tutor] Reading from a GUI
Sat, 3 Feb 2001 10:51:34 +0900
I think we would all save a lot of time if there were a clear answer to your
question. I can only throw in a couple observations.
1. There is actually a book called "Python and Tkinter Programming". From
this standpoint, this is the most well-documented. Check out your favorite
bookstore for more information.
2. There are a few pages that discuss this:
3. Personally, I haven't done enough GUI programming in EITHER environment
to answer the question.
4. In many cases the better question is "What is the best way to build
active web pages in Python?" You can develop CGI scripts for simpler stuff.
You can use Zope for more sophisticated environments, but with a higher
learning curve. I am looking for a way to get out of the (painfully)
sessionless nature CGI without the overhead of Zope. PSP (a Python version
of PHP?) may offer an alternative. Regardless, an HTML interface is too
limiting for some applications that could be done better with WxPython or
It looks like WxPython is is easier to use and more powerful in general. And
it looks like the cross-platform support is good enough for most developers.
When I am ready to tackle GUI programming under Python, even though I own
the above book, I will probably look first into WxPython.
But I would appreciate feedback on this as well.
These opinions are my own.
> -----Original Message-----
> From: firstname.lastname@example.org [mailto:email@example.com]On Behalf Of
> Sent: Thursday, January 25, 2001 7:59 AM
> To: 'D-Man'
> Subject: RE: [Tutor] Reading from a GUI
> >D-Man Wrote :
> >What is meant by "escape code" can differ by useage. For example, in
> >Eiffel you would use "%N" as the excape code for a newline. \012 is
> >the octal value of the character. 0xA is the hexadeciaml value and 10
> >is the decimal value. In C/C++/Java/Perl and Python \n is used as the
> >escape for a newline, but with the proper conversion you can use any
> >of these.
> They are the escape code I was looking for.
> >To "read from" a GUI you need to check the docs of the gui you are
> >using. In GTK, for example, there is a funciton get_text in the
> >Gtk.Text widget (or some similar name). The function returns a string
> I'm currently using Tkinter, but from reading this list it seems like the
> most popular Toolkit is GTK, what is the general preference for python,
> i.e. best documentation, ease of use, samples etc < I'm not
> trying to start
> a holy war here, just peoples experiences ;-) >
> >import string
> >my_str = text_widget.get_text()
> >modified_str = string.replace( my_str, "\n" , "<br>" )
> >print my_str
> >pirnt modified_str
> pretty much exactly the code I was after.
> Loads thanks
> I'll let you know how it goes.
> Tutor maillist - Tutor@python.org