beginner question on dinamin buiding of arg list

  • Thread starter Sandro Dentella
  • Start date
S

Sandro Dentella

I need to build-up an arg list to pass to a function.

Suppose I have a dictionary:

opts = { 'user' : 'jack', 'addr' : 'Green Str.'}

and I want to build a cmd line like this:

select( user='jack', addr='Green Str.' )

I'm clueless...

TIA
sandro
*:)
 
A

Alex Martelli

Sandro Dentella said:
I need to build-up an arg list to pass to a function.

Suppose I have a dictionary:

opts = { 'user' : 'jack', 'addr' : 'Green Str.'}

and I want to build a cmd line like this:

select( user='jack', addr='Green Str.' )

select(**opts)

should fit the bill. (it.comp.lang.python is the Italian newsgroup
about Python, by the way;-).


Alex
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,289
Messages
2,571,435
Members
48,120
Latest member
Natbelix

Latest Threads

Top