On May 30, 2014 8:26 AM, "Ganesh Pal" wrote:
>
>
> Hello Python world ,
>
>
> I wanted suggestion on how to modify the below code to help me accomodate
the below two cases
Your question was answered already, but I'd like to point out that optparse
is deprec
Am Sa Mai 31 2014, 13:08:12 schrieb Ganesh Pal:
>> I think you have to do it manually:
>>
>> options, args = parser.parse_args()
>>
>> if options.object == "super_block" and options.path is not None:
>> parser.error("Paths not allowed for 'super_block' object")
>>
>> elif options.object ==
hoice) + ') default: %default]',)
>
> parser.add_option("-p",
> "--
path",action="store",metavar="/mnt/",dest="path",type="string",help="The
> file or directory path in /mnt/",)
>
>
join(object_choice) + ') default: %default]',)
>
> parser.add_option("-p",
> "--path",action="store",metavar="/mnt/",dest="path",type="string",help="The
> file or directory path in /mnt/",)
>
pe='choice',
choices=object_choice,
help='The object type to be corrupted [ choose from ('
+ ','.join(object_choice) + ') default: %default]',)
parser.add_option("-p",
"--path",action="store",metavar="/m
On Sat, Mar 1, 2014 at 5:17 PM, Steven D'Aprano <
steve+comp.lang.pyt...@pearwood.info> wrote:
>
> You should start new threads for new questions. The subject line here has
> nothing to do with the questions you ask.
>
>
Sure Steven and thanks for replying and your suggestion for Question 2
(
>
> handler = object_type_dictionary[options.object_type] # look up the
> function
> handler() # call it
>
> The last two lines could also be merged into one
>
> object_type_dictionary[options.object_type]()
>
> but the first version may be clearer.
>
>
Thanks for your valuable inputs all worked
On Sat, 01 Mar 2014 16:43:11 +0530, Ganesh Pal wrote:
> Iam done with the command line parsing but got stuck while trying to
> implement switch kind of behavior with dictionaries. So posting 2 more
> questions
You should start new threads for new questions. The subject line here has
nothing to
Ganesh Pal wrote:
> Iam using the options.name directly for manipulations is this fine or do
> I need to assign it to variable and then use it
> if options.object_type == 'LIN':
>corrupt_inode()
This is fine. You would only consider storing the value if you are going to
use it very of
>
>
>
> Thanks Peter and Simon for the hints it worked : ) without ' ='
>
> # Python corrupt.py -o INODE -p /ifs/1.txt -q SET -f 1
>
> Current Default Choice :
>
> Choice: INODE
> Choice: SET
> Choice: 1
>
>
>
>
Iam done with the command line parsing but got stuck while trying to
implement sw
>
> They must be running an older version of FreeBSD since the default version
> of python is 2.7.
>
> There is a FreeBSD package for argparse, the command would be something
> like
>pkg_add -r install py26-argparse
>
>
> Rod
>
>
Yes Iam running a older version of FreeBSD ( Iam actually run
On 2014-02-26 04:30, Ganesh Pal wrote:
On Tue, Feb 25, 2014 at 9:55 PM, Peter
Otten <__pete...@web.de> wrote:
As you are just starting I recommend that you use argparse instead of
optparse.
I would love to use argparse but the script that I plan to write
has to run on host machine
On Wed, Feb 26, 2014 at 4:57 PM, Peter Otten <__pete...@web.de> wrote:
>
> If you stick with optparse just pass the options without '='
>
> -qXOR
>
> and
>
> -q XOR
>
> should both work.
>
>
Thanks Peter and Simon for the hints it worked : )
Ganesh Pal wrote:
> On Tue, Feb 25, 2014 at 9:55 PM, Peter Otten <__pete...@web.de> wrote:
>
>>As you are just starting I recommend that you use argparse instead of
> optparse.
>
> I would love to use argparse but the script that I plan to write has to
> run on
On Wednesday, 26 February 2014 09:30:21 UTC, Ganesh Pal wrote:
> Here is what is happening ( only short hand with -)
>
> # python-5.py -p=/ifs/1.txt -q=XOR -f=1234 -n=1 -l
>
> Usage: python-5.py [options]
> python-5.py: error: option -q: invalid choice: '=XOR' (choose from 'XOR',
> 'ADD',
>
>
On Tue, Feb 25, 2014 at 9:55 PM, Peter Otten <__pete...@web.de> wrote:
>As you are just starting I recommend that you use argparse instead of
optparse.
I would love to use argparse but the script that I plan to write has to
run on host machines that Python 2.6
I have freebsd clie
On 25/02/2014 15:31, Ganesh Pal wrote:
Hi Folks ,
Iam newbie to Python, Iam trying to use optparse module and write a
script that will parse the command line options ..I had to use opt parse
instead of argparse because by host Operating system is still using
python 2.6
Do you have the
Ganesh Pal wrote:
> Iam newbie to Python, Iam trying to use optparse module and write a script
> that will parse the command line options ..I had to use opt parse instead
> of argparse because by host Operating system is still using python 2.6
As you are just starting I recommend tha
Hi Folks ,
Iam newbie to Python, Iam trying to use optparse module and write a script
that will parse the command line options ..I had to use opt parse instead
of argparse because by host Operating system is still using python 2.6
Below is the simple program ( Feel free to correct the error
ot;/usr/lib64/python2.6/optparse.py", line 577, in __init__
> checker(self)
> File "/usr/lib64/python2.6/optparse.py", line 706, in _check_nargs
> self)
> optparse.OptionError: option -s: 'nargs' must not be supplied for action
> 'store_t
Andy
2013/8/27 Andy Kannberg
> Hello Peter,
>
> Thanks for the example. For now I am restricted to Python 2.6, so no
> argparse for me at the moment.
>
> cheers,
> Andy
>
>
> 2013/8/26 Peter Otten <__pete...@web.de>
>
>> Andy Kannberg wrote:
>>
>&
Andy Kannberg wrote:
> Hi python-guru's,
>
> I am new to Python, coming from a long history of Unix/linux shell
> programming.
> I am creating a Python script (In Python 2.6) which should be able to
> read command line options and arguments.
> So far, I figured out ho
Hi python-guru's,
I am new to Python, coming from a long history of Unix/linux shell
programming.
I am creating a Python script (In Python 2.6) which should be able to read
command line options and arguments.
So far, I figured out how to do that with optparse. I can add options (and
argu
n of 'concrete use case', but anyway...
It's actually closer to the truth than it might seem. I want to feed a
bash-completion-style thing, using the same data structure to both
figure out the possible completions and also do the actual parsing. "Do
the actual parsing" = optpars
> if I asked for it I might get it in a future version?
Not in optparse, as it's no longer being developed. For argparse, you
might want a better use case: adding functionality to support a
hypothetical "lack" of functionality (which is _actually_ provides)
seems like a pedantic exercise to me.
--
http://mail.python.org/mailman/listinfo/python-list
his.
Even if I were to do something like
options = [ make_option(...), make_option(...) ]
(using optparse) and could thus get a handle on the Option objects,
there doesn't seem to be a public API for retrieving stuff like the
actual options (though available via opt._short_opts and opt._lo
On 01/05/2012 11:46 AM, Ian Kelly wrote:
> On Thu, Jan 5, 2012 at 11:14 AM, Ian Kelly wrote:
>> On Thu, Jan 5, 2012 at 1:05 AM, ru...@yahoo.com wrote:
>>> I have optparse code that parses a command line containing
>>> intermixed positional and optional arguments, where
On Thu, Jan 5, 2012 at 11:14 AM, Ian Kelly wrote:
> On Thu, Jan 5, 2012 at 1:05 AM, ru...@yahoo.com wrote:
>> I have optparse code that parses a command line containing
>> intermixed positional and optional arguments, where the optional
>> arguments set the context for the
On Thu, Jan 5, 2012 at 1:05 AM, ru...@yahoo.com wrote:
> I have optparse code that parses a command line containing
> intermixed positional and optional arguments, where the optional
> arguments set the context for the following positional arguments.
> For example,
>
> mypr
On 01/05/2012 02:19 AM, Ulrich Eckhardt wrote:
> Am 05.01.2012 09:05, schrieb ru...@yahoo.com:
>> I have optparse code that parses a command line containing
>> intermixed positional and optional arguments, where the optional
>> arguments set the context for the following
Am 05.01.2012 09:05, schrieb ru...@yahoo.com:
I have optparse code that parses a command line containing
intermixed positional and optional arguments, where the optional
arguments set the context for the following positional arguments.
For example,
myprogram.py arg1 -c33 arg2 arg3 -c44 arg4
On Jan 5, 1:05 am, "ru...@yahoo.com" wrote:
> class AppendWithPos (argparse.Action):
> def __call__ (self, parser, namespace, values,
> option_string=None):
> if getattr (namespace, self.dest, None) is None:
> setattr (namespace, self.dest, [])
> getattr (namespac
I have optparse code that parses a command line containing
intermixed positional and optional arguments, where the optional
arguments set the context for the following positional arguments.
For example,
myprogram.py arg1 -c33 arg2 arg3 -c44 arg4
'arg1' is processed in a default conte
rser fail if an argument's value (which has no default
> explicitly specified) is not specified. I may miss some thing in the
> manual. Could any expert let me know if there is a way to do so?
> Thanks!
>
> #!/usr/bin/env python
>
> from optparse import OptionParser
>
&g
Don't specify it as an option, but as an argument.
If you're on a new version of python, you should probably use argparse.
--
http://mail.python.org/mailman/listinfo/python-list
ly specified) is not specified. I may miss some thing in the
manual. Could any expert let me know if there is a way to do so?
Thanks!
#!/usr/bin/env python
from optparse import OptionParser
usage = 'usage: %prog [options] arg1 arg2'
parser = OptionParser(usage=usage)
parser.set_defa
On Thursday, September 1, 2011 7:16:13 PM UTC-7, Roy Smith wrote:
> In article ,
> Terry Reedy wrote:
>
> > Do note "The optparse module is deprecated and will not be developed
> > further; development will continue with the argparse module."
>
> One of
Fulvio writes:
> Terry Reedy wrote:
>
> > Do note "The optparse module is deprecated and will not be developed
> > further; development will continue with the argparse module."
>
> Then,do you propose me to opt to argparse?
Without argument, yes; though for now
Terry Reedy wrote:
> Do note "The optparse module is deprecated and will not be developed
> further; development will continue with the argparse module."
Then,do you propose me to opt to argparse?
--
Archlinux on $(uname -a) :P
F
--
http://mail.python.org/mailman/listinfo/python-list
In article ,
Terry Reedy wrote:
> Do note "The optparse module is deprecated and will not be developed
> further; development will continue with the argparse module."
One of the unfortunate things about optparse and argparse is the names.
I can never remember which is the n
On 9/1/2011 5:12 PM, Fulvio wrote:
I'm on python3.2, trying some experiment with OptionParser but no success
Do note "The optparse module is deprecated and will not be developed
further; development will continue with the argparse module."
--
Terry Jan Reedy
--
http://
On Thu, Sep 1, 2011 at 5:12 PM, Fulvio wrote:
> Hello,
>
> I'm on python3.2, trying some experiment with OptionParser but no success
>
> >>> from optparse import OptionParser as parser
> >>> parser.add_option('-n','--new',
On Thu, Sep 1, 2011 at 3:12 PM, Fulvio wrote:
> Hello,
>
> I'm on python3.2, trying some experiment with OptionParser but no success
>
>>>> from optparse import OptionParser as parser
>>>> parser.add_option('-n','--new', dest='
Hello,
I'm on python3.2, trying some experiment with OptionParser but no success
>>> from optparse import OptionParser as parser
>>> parser.add_option('-n','--new', dest='new')
>>>
* Thomas 'PointedEars' Lahn (Thu, 12 May 2011 22:22:20 +0200)
> Thorsten Kampe wrote:
> > I'm using optparse for a little Python script.
> >
> > 1. The output from "--help" is:
> > """
> > Usage: script.py
> >
&
On 05/12/2011 10:22 PM, Thomas 'PointedEars' Lahn wrote:
Thorsten Kampe wrote:
I'm using optparse for a little Python script.
1. The output from "--help" is:
"""
Usage: script.py
script.py does something
Options:
-h, --help show this help mess
Thorsten Kampe wrote:
> I'm using optparse for a little Python script.
>
> 1. The output from "--help" is:
> """
> Usage: script.py
>
> script.py does something
>
> Options:
> -h, --help show this help message and exit
> &
Hi,
I'm using optparse for a little Python script.
1. The output from "--help" is:
"""
Usage: script.py
script.py does something
Options:
-h, --help show this help message and exit
"""
I would prefer to have the description before the usage
Try this on your *nix command line: echo ">$100"
On a *nix command line, the '$1' part of ">$100" will be seen as 'give me the
value of the shell variable "1"', and since it has no value, will result in an
empty string. So it's not o
tazz_ben wrote:
> So, I'm using optparse as follows:
>
> Command line:
> python expense.py ">$100" -f ~/desktop/test.txt
> ['>00']
>
>
> In Main:
>
> desc = ''
> p = optparse.OptionParser(description=desc)
>
&g
In
tazz_ben writes:
> So, any ideas? Why is including a $ eating both the dollar signa and the 1?
Unix command lines tend to assume any $ inside double-quotes is a shell
variable name. Try enclosing in single-quotes instead.
--
John Gordon A is for Amy, who fell down the
So, I'm using optparse as follows:
Command line:
python expense.py ">$100" -f ~/desktop/test.txt
['>00']
In Main:
desc = ''
p = optparse.OptionParser(description=desc)
utilities = optparse.OptionGroup(p, 'Utility Options')
utilities.a
> But I find it dumb to encode and decode a dictionary... So I would
> like to know how I if there is a good way of passing a dictionary to
> optparse and benefiting from its option management (check, error
> detection, etc).
I don't think you can get away from encoding/de
On Apr 8, 11:58 pm, Karim wrote:
> On 04/07/2011 10:37 AM, markolopa wrote:
>
> > Is there support/idioms/suggestions for usingoptparsewithout a
> >commandline?
>
> > I have a code which used to be called through subprocess. The whole
> > flow of the code is based on what 'options' object fromoptp
On 04/07/2011 10:37 AM, markolopa wrote:
Hello,
Is there support/idioms/suggestions for using optparse without a
command line?
I have a code which used to be called through subprocess. The whole
flow of the code is based on what 'options' object from optparse
contains.
Now I want to
Hello,
Is there support/idioms/suggestions for using optparse without a
command line?
I have a code which used to be called through subprocess. The whole
flow of the code is based on what 'options' object from optparse
contains.
Now I want to call this code without subprocessing.
nse code is returned.
>
> HTH
>
> Joost
>
>
> On 10 December 2010 17:36, samwyse wrote:
>
>> Has anyone ever built some sort of optparse/argparse module for cgi/
>> wsgi programs? I can see why a straight port wouldn't work, but a
>> module that can organ
called, else a 'Method Not Allowed'
response code is returned.
HTH
Joost
On 10 December 2010 17:36, samwyse wrote:
> Has anyone ever built some sort of optparse/argparse module for cgi/
> wsgi programs? I can see why a straight port wouldn't work, but a
> module that
Has anyone ever built some sort of optparse/argparse module for cgi/
wsgi programs? I can see why a straight port wouldn't work, but a
module that can organize parameter handling for web pages seems like a
good idea, especially if it provided a standard collection of both
client- and server
On Thu, Aug 12, 2010 at 12:41, Robert Kern wrote:
> On 8/12/10 11:19 AM, J wrote:
>>
>> How do you use OptParse with constants?
> http://docs.python.org/library/optparse#standard-option-actions
>
> 'store_const' means that the option is a flag without arguments
On 8/12/10 11:19 AM, J wrote:
How do you use OptParse with constants?
Example:
usage = 'Usage: %prog [OPTIONS]'
parser = OptionParser(usage)
parser.add_option('-l','--level',
action='store_const',
How do you use OptParse with constants?
Example:
usage = 'Usage: %prog [OPTIONS]'
parser = OptionParser(usage)
parser.add_option('-l','--level',
action='store_const',
default=LOG_INFO,
On Jun 28, 11:47 pm, rantingrick wrote:
> Give your *script* an
> enema, and do *yourself* a favor by harnessing the simplistic elegance
> of the "optphart" module instead!
>
> #-- Start Script --#
> def optphart(args):
> d = {'args':[]}
> for arg in args:
> if arg.startswith('-'):
On Jun 28, 9:56 pm, Ben Finney wrote:
> Michele Simionato writes:
> > optparse is so old-fashioned. Use plac!
>
> The OP should be made aware that:
>
> * plac is a third-party library with (TTBOMK) no prospect of inclusion
> in the standard library
>
> * optparse
On Jun 28, 10:44 am, Michele Simionato
wrote:
> optparse is so old-fashioned. Use plac!
Hog wash! Both are archaic and asinine. Both clog your scripts with
wasted lines and your memory with complex interfaces far worse than
colon clogging junk food can hold a candle to. Give your *script*
Michele Simionato writes:
> optparse is so old-fashioned. Use plac!
The OP should be made aware that:
* plac is a third-party library with (TTBOMK) no prospect of inclusion
in the standard library
* optparse is in the standard library and has been for many versions
* argparse is a th
type="str",
> help="T(op) or B(ottom)")
>
> (options, args) = parser.parse_args()
> if len(args) != 1:
> parser.error("incorrect number of arguments")
> lines=options.lines
> tb=options.topbottom
>
On 28 June 2010 14:30, dirknbr wrote:
> I get an int object is not callable TypeError when I execute this. But
> I don't understand why.
> (snip)
> lines=options.lines
Here you are assigning the -l option to the name 'lines'.
> lines(args[0],topbottom=tb,maxi=lines)
Here you are attemptin
I get an int object is not callable TypeError when I execute this. But
I don't understand why.
parser = optparse.OptionParser("usage: %lines [options] arg1")
parser.add_option("-l", "--lines", dest="lines",
default=10, type="int",
help="number of
is the most simple way to parser options.
Can you please suggest any other best way / optimized way to parse
these kind of options.
Thank you in advance.
Here's a solution:
import optparse
class Process:
PREFIX = 'dispatch_'
@staticmethod
def undef()
On Jun 8, 4:30 pm, Hrvoje Niksic wrote:
> Thomas Jollans writes:
> > UNIX and GNU recommendations. I've never actually heard of optparser,
> > but I'd expect it to have the usual limitations:
>
> Hiralprobably meant to write "optparse", which supports GNU
ser.add_option("-oppt', dest=ppt_file...)
>
> > The above way is the most simple way to parser options.
> > Can you please suggest any other best way / optimized way to parse
> > these kind of options.
>
> > Thank you in advance.
>
> Here's a s
Thomas Jollans writes:
> UNIX and GNU recommendations. I've never actually heard of optparser,
> but I'd expect it to have the usual limitations:
Hiral probably meant to write "optparse", which supports GNU-style
options in a fairly standard and straightforward
hiral wrote:
> Hi,
>
> I am using optparser to do following...
>
> Command syntax:
> myscript -o[exension] other_arguments
> where; extension can be 'exe', 'txt', 'pdf', 'ppt' etc.
>
>
> Now to parse this, I am doing following...
>
> parser.add_option("-oexe', dest=exe_file...)
> parser.a
On Jun 8, 10:38 am, hiral wrote:
> Hi,
>
> I am using optparser to do following...
>
> Command syntax:
> myscript -o[exension] other_arguments
> where; extension can be 'exe', 'txt', 'pdf', 'ppt' etc.
>
> Now to parse this, I am doing following...
>
> parser.add_option("-oexe', dest=exe_file..
ix including the full-stop (‘.’)
character.
What your example suggests is that you want to have an option, “-o”,
which takes an argument which is the output suffix. I'd prefer to also
have a long option with a descriptive name for the same purpose.
So here's my interpretation::
ay to parse
these kind of options.
Thank you in advance.
Here's a solution:
import optparse
class Process:
PREFIX = 'dispatch_'
@staticmethod
def undef():
print 'unsupported file type'
@staticmethod
def dispatch_exe():
print 'Hello exe
On 2010-06-08 10:38, hiral wrote:
> Hi,
>
> I am using optparser to do following...
>
> Command syntax:
> myscript -o[exension] other_arguments
> where; extension can be 'exe', 'txt', 'pdf', 'ppt' etc.
>
>
> Now to parse this, I am doing following...
>
> parser.add_option("-oexe', dest=exe_file
Hi,
I am using optparser to do following...
Command syntax:
myscript -o[exension] other_arguments
where; extension can be 'exe', 'txt', 'pdf', 'ppt' etc.
Now to parse this, I am doing following...
parser.add_option("-oexe', dest=exe_file...)
parser.add_option("-otxt', dest=txt_file...)
par
Is there a way to use the optparser parser.print_help() so that it
ONLY prints out the options, and NOT the usage?
thanks
--
http://mail.python.org/mailman/listinfo/python-list
On Wed, 16 Dec 2009 23:10:26 -0800, Enchanter wrote:
> I am learning Python and uising optparse to handle command-line options.
> But I am not sure who to print the options' content below:
>
> .
>
> options, args = parser.parse_args()
Is there a reason why
print op
n2.6/lib/python2.6/optparse.py", line 1578, in
error
self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg))
File "/usr/local/python2.6/lib/python2.6/optparse.py", line 1568, in
exit
sys.exit(status)
SystemExit: 2
>> begin captured
ython2.6/optparse.py", line 1578, in error
self.exit(2, "%s: error: %s\n" % (self.get_prog_name(), msg))
File "/usr/local/python2.6/lib/python2.6/optparse.py", line 1568, in exit
sys.exit(status)
SystemExit: 2
>> begin captured stdout <<
On 2009-10-23 05:54 AM, Filip Gruszczyński wrote:
That being said, I still stick with optparse. I prefer the dogmatic
interface that makes all my exe use the exact same (POSIX) convention. I
really don't care about writing /file instead of --file
I would like to keep POSIX convention too
> That being said, I still stick with optparse. I prefer the dogmatic
> interface that makes all my exe use the exact same (POSIX) convention. I
> really don't care about writing /file instead of --file
I would like to keep POSIX convention too, but just wanted
OptionParser to do
Filip Gruszczyński wrote:
optparse module is quite smart, when it comes to validating options,
like assuring, that certain option must be an integer. However, I
can't find any information about validating, that positional arguments
were provided and I can't find methods, that w
optparse module is quite smart, when it comes to validating options,
like assuring, that certain option must be an integer. However, I
can't find any information about validating, that positional arguments
were provided and I can't find methods, that would allow defining
positional a
Jean-Michel Pichavant wrote:
Carl Banks wrote:
On Oct 15, 10:29 pm, Mark Harrison wrote:
What's the magic to allow this? If the value is not specified I
would like to use the default value of 1.
import optparse
p=optparse.OptionParser()
p.add_option("--debug")
(opts, args)
Carl Banks wrote:
On Oct 15, 10:29 pm, Mark Harrison wrote:
What's the magic to allow this? If the value is not specified I
would like to use the default value of 1.
import optparse
p=optparse.OptionParser()
p.add_option("--debug")
(opts, args) = p.parse_args(['--deb
What's the magic to allow this? If the value is not specified I
would like to use the default value of 1.
import optparse
p=optparse.OptionParser()
p.add_option("--debug")
(opts, args) = p.parse_args(['--debug=22']); print opts
(opts, args) = p.parse_args(['--deb
On Oct 15, 10:29 pm, Mark Harrison wrote:
> What's the magic to allow this? If the value is not specified I
> would like to use the default value of 1.
>
> import optparse
> p=optparse.OptionParser()
> p.add_option("--debug")
>
> (opts, args) = p.parse_a
Unfortunately, I had no luck installing argparse, which is really confusing
because I would need to use some old version pre-optik to use I think. The
Jython I use is like python 2.2.3. I spent all of yesterday trying to get
either getopt, argparse, or optparse to work. Even with optparse I
l with options that have
> spaces in them. I am using jython, which is the same I think as python
> 2.2.3. I feebly tried to use optparse and argparse with no success (got
> gettext, locale, and optparse). The code is as follows:
>
> try:
> (o
Hello,
I have been trying to find an example of how to deal with options that have
spaces in them. I am using jython, which is the same I think as python 2.2.3.
I feebly tried to use optparse and argparse with no success (got gettext,
locale, and optparse). The code is as follows
On 2009-05-20 16:50, Joseph Garvin wrote:
I'm working on a python script that takes several command line flags,
currently parsed by hand. I'd like to change the script to parse them
with OptionParser from the optparse module. However, currently the
script invokes a subprocess, and any
I'm working on a python script that takes several command line flags,
currently parsed by hand. I'd like to change the script to parse them
with OptionParser from the optparse module. However, currently the
script invokes a subprocess, and any flags the script doesn't
understand
Ben Finney wrote:
> icarus writes:
>
>> parser = optparse.OptionParser(usage="%prog [-p dir] [--part=dir] ",
>> version="%prog 1.0")
>>
>> parser.add_option( "-p", "--part", dest="directory",
>>help="process target directory", metavar="dir")
>> (options, arg
icarus writes:
> parser = optparse.OptionParser(usage="%prog [-p dir] [--part=dir] ",
> version="%prog 1.0")
>
> parser.add_option( "-p", "--part", dest="directory",
> help="process target directory", metavar="dir")
> (options, args) = parser.parse_args(
On 2009-05-19 16:07, icarus wrote:
Why do I need to put two options for this script to print the path?
if I just specify the option and argument...
$ python
Why do I need to put two options for this script to print the path?
if I just specify the option and argument...
$ python
1 - 100 of 353 matches
Mail list logo