Roland Heiber wrote: >Francois De Serres wrote: > > >>Hiho, >> >>Having a string: "dothat" >>and a tuple: (x, y) >>1. What's the best way to build a function call like: dothat(x,y)? >> >> > >Not the best (not at all) but one way: > > Still pretty interesting, thx.
>def dothat(x,y):
> print "Called with:", x, y
>
>c = (1,2)
>
>locals().get("dothat")(*c)
>
>----
>Called with: 1 2
>
>HtH, Roland
>
>
--
http://mail.python.org/mailman/listinfo/python-list
