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
>>>
Aaah it doesn't work from idle but it does from the command line...
--
http://mail.python.org/mailman/listinfo/python-list
>
> 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
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
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
> 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
> 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
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
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