CLI+GUI

Michael Hudson mwh at python.net
Thu Aug 14 08:11:01 EDT 2003


mis6 at pitt.edu (Michele Simionato) writes:

> I wonder what is the recommended way of using Tkinter
> together with a command line oriented application. 
> I have in mind something like that:
[...]

Um.  I'm coming to this thread late, but my pyrepl package works quite
nicely with Tkinter programs (on Unix, anyway).

$ pythoni
Python 2.2.1 (#1, Apr  9 2002, 13:10:27) 
[GCC 2.96 20000731 (Red Hat Linux 7.1 2.96-98)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
->> import Tk
Traceback (most recent call last):
  File "<input>", line 2, in ?
ImportError: No module named Tk
->> import Tkinter
->> root = Tkinter.Tk()
->> label = Tkinter.Label(root, text="hi!")
->> label.pack()

... just like the native toplevel (which isn't surprising, as that's
where I cribbed the code from).

HTH,
mwh

-- 
  QNX... the OS that walks like a duck, quacks like a duck, but is,
  in fact, a platypus. ... the adventures of porting duck software 
  to the platypus were avoidable this time.
                                 -- Chris Klein, alt.sysadmin.recovery




More information about the Python-list mailing list