blanks embedded in python 2.3 optparse

P

pascal barbedor

Hi

is there a way to pass a param with blank embedded with optparse ?
(C:\Python23\Doc\lib\module-optparse.html)


for instance
prog --name=mr jones


and have "mister jones" as a single entry for name ?

reading the docs I see nothing about that.

the only thing is the nargs to pass nargs at a time, but here you can't tell
in advance how many words in the name there is

thanks
 
K

Karl Scalet

pascal said:
Hi

is there a way to pass a param with blank embedded with optparse ?
(C:\Python23\Doc\lib\module-optparse.html)


for instance
prog --name=mr jones

you need to quote the name like
prog --name="mr jones"

That should work

Karl
 
?

=?ISO-8859-2?Q?Nagy_L=E1szl=F3_Zsolt?=

is there a way to pass a param with blank embedded with optparse ?
(C:\Python23\Doc\lib\module-optparse.html)


for instance
prog --name=mr jones


and have "mister jones" as a single entry for name ?

reading the docs I see nothing about that.

the only thing is the nargs to pass nargs at a time, but here you can't tell
in advance how many words in the name there is

For Unix and windows:

prog --name="mr jones"

For unices, this should work too:

prog --name=mr\ jones

Know nothing about macs and others.

Laci
 

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

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,043
Latest member
CannalabsCBDReview

Latest Threads

Top