473,324 Members | 2,567 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,324 software developers and data experts.

Python 2.3 problem

Hi

When I does this like hear failre goes:

def pinhtranh(*args, laoc_te):
phnoi_crek(args, laoc_te)

I do "laoc_te" last praemetr name always.
Qinh
Jul 18 '05 #1
3 1248
There is way to few information in this mail, but I guess you meant the
following:

def pinhtranh(*args, laoc_te):
phnoi_crek(*args, laoc_te)

Note the *args on the second line.

Regards,
Florian

On Sun, 24 Aug 2003 22:00:01 +0200 (CEST), Nomen Nescio <no****@dizum.com>
wrote:
Hi

When I does this like hear failre goes:

def pinhtranh(*args, laoc_te):
phnoi_crek(args, laoc_te)

I do "laoc_te" last praemetr name always.
Qinh


--
Using M2, Opera's revolutionary e-mail client: http://www.opera.com/m2/
Jul 18 '05 #2
In article <51******************************@dizum.com>, Nomen Nescio wrote:
Hi

When I does this like hear failre goes:

def pinhtranh(*args, laoc_te):
phnoi_crek(args, laoc_te)

I do "laoc_te" last praemetr name always.

This is not allowed.

*args and **kwargs must come after the regular arguments.

http://python.org/doc/current/tut/no...00000000000000

Jul 18 '05 #3
On Sunday 24 August 2003 01:00 pm, Nomen Nescio wrote:
Hi

When I does this like hear failre goes:

def pinhtranh(*args, laoc_te):
phnoi_crek(args, laoc_te)

I do "laoc_te" last praemetr name always.
Qinh


The syntax of Python does not allow this, but perhaps the following
will do what you want. The two lines in pinhtranh will set "laoc_te"
to the last argument, and "args" to a tuple of all except for the last
argument.

def pinhtranh(*allArgs):
args = allArgs[:-1]
laoc_te = allArgs[-1]
...

I hope that's what you wanted.

Gary Herron

Jul 18 '05 #4

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

Similar topics

14
by: David MacQuigg | last post by:
I am starting a new thread so we can avoid some of the non-productive argument following my earlier post "What is good about Prothon". At Mr. Hahn's request, I will avoid using the name "Prothon"...
68
by: Lad | last post by:
Is anyone capable of providing Python advantages over PHP if there are any? Cheers, L.
112
by: mystilleef | last post by:
Hello, What is the Pythonic way of implementing getters and setters. I've heard people say the use of accessors is not Pythonic. But why? And what is the alternative? I refrain from using them...
0
by: Kurt B. Kaiser | last post by:
Patch / Bug Summary ___________________ Patches : 417 open ( -6) / 3565 closed (+12) / 3982 total ( +6) Bugs : 960 open ( -3) / 6498 closed (+19) / 7458 total (+16) RFE : 266 open...
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: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
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...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
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...

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.