KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
With Perl's Getopt::Long you can easily define command-line options that take a variable number of arguments: foo.pl --files a.txt --verbose foo.pl --files a.txt b.txt c.txt --verbose Is there a way to do this directly with Python's optparse module? As far as I can tell, the nargs option attribute can be used to specify a fixed number of option arguments, and I have not seen other alternatives in the documentation.
Tags (comma-separated)
Save Edits
Cancel