parameters to lambda's executed at run time.

2008-05-06 Thread wyleu
I'm trying to supply parameters to a function that is called at a later time as in the code below: llist = [] for item in range(5): llist.append(lambda: func(item)) def func(item): print item for thing in llist: thing() which produces the result IDLE 1.2.1 >>>

Re: Reading a keypress

2008-02-25 Thread wyleu
Aaah it doesn't work from idle but it does from the command line... -- http://mail.python.org/mailman/listinfo/python-list

Re: Reading a keypress

2008-02-25 Thread wyleu
> > A recipe that supposedly does this in a cross-platform > way:http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/134892 class _Getch: """Gets a single character from standard input. Does not echo to the screen.""" def __init__(self): try: self.impl = _GetchWi

Reading a keypress

2008-02-25 Thread wyleu
I'm trying to read a single keypress on Linux but expect to have the programme running on Windows platform as well and find the mention in the FAQ: import termios, fcntl, sys, os fd = sys.stdin.fileno() oldterm = termios.tcgetattr(fd) newattr = termios.tcgetattr(fd) newattr[3] = newattr[3] & ~ter

Re: _tkinter installation in python 2.5 on mandriva with a default 2.4

2007-10-31 Thread wyleu
On 31 Oct, 18:46, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Those TK libraries tcllib=None tklib=None tcl_includes=None > > tk_includes=None > > This also contradicts your earlier statement that you have libtk8.4.so > on your machine. [EMAIL PROTECTED] Python-2.5.1]$ ls -las /usr/lib/lib

Re: _tkinter installation in python 2.5 on mandriva with a default 2.4

2007-10-31 Thread wyleu
> tk.h is searched-for in detect_tkinter. Check whether tklib, tcllib, > tcl_includes and tk_includes all get set. This should take only > a single print statement. > > Regards, > Martin Ok I've cleared my increasingly frantic copies out [EMAIL PROTECTED] python2.5]# find / -name tk.h /usr/inclu

Re: _tkinter installation in python 2.5 on mandriva with a default 2.4

2007-10-31 Thread wyleu
> So where it tk.h located? tk.h is now in just about every directory called include that could in anyway be connected with this and indeed it does appear in the make file printout: /usr/bin/install -c -m 644 ./Include/sysmodule.h /usr/local/include/ python2.5 /usr/bin/install -c -m 644 ./Inclu

Re: _tkinter installation in python 2.5 on mandriva with a default 2.4

2007-10-30 Thread wyleu
On 30 Oct, 22:36, "Martin v. Löwis" <[EMAIL PROTECTED]> wrote: > > Should I need to download a later version of tkinter and/or should I > > alter setup.py in my python install directory and then remake? > > Neither, nor. You need the Tk header files installed; they probably > come in a package call

_tkinter installation in python 2.5 on mandriva with a default 2.4

2007-10-30 Thread wyleu
I'm running on Mandriva 2007 (2.6.17-5mdv) and thus have python2.4.3 installed by default, I'm running code requiring yield(), so need python2.5 and have installed this sucessfully, and linked appropriately to allow me to start python2.5 by typing python2.5. However I'd like to use idle so requir