473,289 Members | 2,091 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,289 software developers and data experts.

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

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
Oct 28 '07 #1
2 1516
stef mientki <st**********@gmail.comwrote:
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 ) )
Try:
dc.SetClippingRegion ( *self._point2ClientCoord (p1, p2 ) )
Oct 28 '07 #2
thanks Duncan, Matthieu and Ed (offlist),
this is exactly what I was looking for.

cheers,
Stef

Duncan Booth wrote:
stef mientki <st**********@gmail.comwrote:

>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 ) )
Try:
dc.SetClippingRegion ( *self._point2ClientCoord (p1, p2 ) )
Oct 28 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: Nicolas Girard | last post by:
Hi, Forgive me if the answer is trivial, but could you tell me how to achieve the following: {k1:,k2:v3,...} --> ,,,...] The subtle point (at least to me) is to "flatten" values that are...
2
by: Greg Smethells | last post by:
What exactly does "*values" mean in the following code? Is this a pointer to a PyList? Why can I not find good documentation on this any where? I must be blind: >>> from struct import * >>>...
0
by: Jan | last post by:
I store sql-commands in a database table. In the first step I get the sql command out of the database table with embedded sql. In the second step I try to execute the command, which i got from the...
3
by: Martin Ink | last post by:
I have a program linked to an .exe and this program is started from an other program. I would like to control the execution of the program so that the program only runs 'single threaded'. I don't...
3
by: Paul Janssen | last post by:
Hello! Can anyone help me out with the following situation: (a) a single query with 550 id's in the IN-clause resulting into 800+ seconds; (b) 550 queries with a single id in the IN-clause...
9
by: Bob Alston | last post by:
I have a drop down combo box that gives the user to enter an item not in the list by adding it to the list. The list is a table. It works fine on Access2003 but fails on Access2002/XP. ON XP, it...
4
by: charliewest | last post by:
Hello - I've binded a dataset to a Drop Down List control on my web form, using C#, however, the DateTime value is printed in long format. For example: 04/07/2006 12:00 AM. My code is: ...
9
by: Marco Castro | last post by:
I tried to google for information of what the output of the "LIST" command means but couldn't find any articles that tell me exactly what every character means. I can figure out most of it, its...
6
by: Nirjhar Oberoi | last post by:
Hi, Can you add two numbers using a Single Variable? :-) If yes then show me the code!!! Regards Nirjhar
4
by: mistyblu | last post by:
I wrote an Access97 application using VBA for a company many moons ago and they have approximately 20 users. All has been hunky dory for a long time but suddenly they have a combo box error on 3 of...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.