A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from http://mail.python.org/pipermail/python-list/2001-April/082606.html below:

newbie: callback functions

newbie: callback functions newbie: callback functionsRainer Deyke root at rainerdeyke.com
Tue Apr 17 13:45:26 EDT 2001
<koenig at v-i-t.de> wrote in message
news:9bhs59$kej$1 at sun27.hrz.tu-darmstadt.de...
> hi
>
> in tkinter:
> why can callback functions onlx have one parameter?
> when i press a button, i want that a function is executed with many
parameters,
> so that i can pass the function a filename or something to work with that.
>
> how can i do such things?

Tuples are your friends.

def f(args):
  a, b = args
  print 'Received args %s and %s.' % (a, b)

def call_f(arg):
  f(arg)

call_f(('Hello', 'spam'))



--
Rainer Deyke (root at rainerdeyke.com)
Shareware computer games           -           http://rainerdeyke.com
"In ihren Reihen zu stehen heisst unter Feinden zu kaempfen" - Abigor



More information about the Python-list mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4