how to convert tuple to a "list of single values" ?

Matthieu Brucher matthieu.brucher at gmail.com
Sun Oct 28 16:56:51 CET 2007


Use :

      something = self._point2ClientCoord (p1, p2 )
      dc.SetClippingRegion (*something)

Matthieu

2007/10/28, stef mientki <stef.mientki at gmail.com>:
>
> hello,
>
> The next piece of code bothers me:
>
>       ptx, pty, rectWidth, rectHeight = self._point2ClientCoord (p1, p2 )
>       dc.SetClippingRegion ( ptx, pty, rectWidth, rectHeight )
>
> Because I want to write it in 1 line,
> and without the use of intermediate variables (for which I have to
> invent names ;-)
> like this:
>
>     dc.SetClippingRegion ( self._point2ClientCoord (p1, p2 ) )
>
> Now that doesn't work, because
> - dc.SetClippingRegion() requires 4 integer parameters
> - _point2ClientCoord()  returns a tupple of 4 integers
>
> I can't think of a solution,
> is there any ?
>
> thanks,
> Stef Mientki
>
>
> --
> http://mail.python.org/mailman/listinfo/python-list
>



-- 
French PhD student
Website : http://miles.developpez.com/
Blogs : http://matt.eifelle.com and http://blog.developpez.com/?blog=92
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20071028/8a766798/attachment.html>


More information about the Python-list mailing list