473,383 Members | 1,717 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,383 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 1519
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...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

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.