bokr at oz.net
Sun Jun 1 10:37:02 CEST 2003
On Sun, 1 Jun 2003 09:53:20 +0200 (CEST), Arnd Baecker <arnd.baecker at web.de> wrote:
>I have a question concerning modifying a line created
>within a Canvas:
>It boils down to that (for `plot` being a Canvas)
I would try prefixing a '*' on the theory that the function is defined like foo below:
>>> def foo(first, *rest): print first,rest
1 (2, 3, 4)
>>> r = [2,3,4]
1 ([2, 3, 4],)
Note what happened in the preceding: the entire r simply became the first and only
arg in the args tuple, which has length 1 instead of 3.
1 (2, 3, 4)
Compare this result to the original. We have unpacked r into the arg sequence,
so the r elements show up as if they had been passed as separate args.
>raises the error:
> TclError: bad screen distance "[10,"
>((Maybe the example below more clearly demonstrates what I mean here.))
>Actually, help(Tkinter.Canvas.coords) gives
> coords(self, *args) unbound Tkinter.Canvas method
looks like foo above.
If the above works, we can go on to the next problem, which someone else
will have to get into if it's going to happen tonight ;-)
More information about the Python-list