Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.lang.python > #53009
| From | Andy Kannberg <andy.kannberg@gmail.com> |
|---|---|
| Date | 2013-08-26 18:16 +0200 |
| Subject | optparse question (python 2.6) |
| Newsgroups | comp.lang.python |
| Message-ID | <mailman.242.1377534246.19984.python-list@python.org> (permalink) |
[Multipart message — attachments visible in raw view] - view raw
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 arguments ) . There are about 7 options that can be selected. However, I can't seem to figure out how to force that only one option is allowed when the script is invoked. In other words: How to restrict the script to accept only one of the available options ? cheers, Andy
Back to comp.lang.python | Previous | Next | Find similar | Unroll thread
optparse question (python 2.6) Andy Kannberg <andy.kannberg@gmail.com> - 2013-08-26 18:16 +0200
csiph-web