previous next Up Title Contents Index

User interraction


def ask_ok(prompt, retries=4, complaint='Yes or no, please!'):

while 1:
ok = raw_input(prompt)
if ok in ('y', 'ye', 'yes'): return 1
if ok in ('n', 'no', 'nop', 'nope'): return 0
retries = retries - 1
if retries < 0: raise IOError, 'refusenik user'
print complaint

ask_ok('toto')

Tkinter

Q : I'm looking for some hints as to how to get Tkinter on Macs to work.
You will find everything you need here: <http://DerSchockwellenreiter.editthispage.com/python/tkinterenglish.html>
Jörg Kantel
Yeah, that's basically it. Here's what worked for me using 1.5.2:
1. Download MacTk 8.3.1, unstuff.
2. "Tool Command Language (PPC)" into the "Tool Command Language" folder, and copy that into the Extensions folder.
3. Add the path to the Tkinter.py module, $Python:Lib:lib-tk
4. Put the MacTk 8.3.1 folder in the Python folder
- Louis M. Pecora


previous next Up Title Contents Index

Version : 1.65 Mise à jour : 11/11/00