| | |
Option parser help needed
Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jan 2009
Posts: 19
Reputation:
Solved Threads: 0
Hi
I am using optparser to design a command line interface.How do I read multiple arguments.
For eg if I want to create a folder, I will take the arguments path and folder name something lilke the following
main.py --createFolder Tesfolder --path C://Test/Test/...
How to read these arguments? I can get optparser to work for single argument,like this
c = cfgparse.ConfigParser()
c.add_file('name_dest.ini')
c.add_option('mail_server')
c.add_option('proxy_server', dest='proxy')
opts = c.parse()
but not with multiple args any help is appreciated
thanks
starzstar
Python Fan
Posts: 5
Joined: Tue Jan 20, 2009 4:39 am
Top
I am using optparser to design a command line interface.How do I read multiple arguments.
For eg if I want to create a folder, I will take the arguments path and folder name something lilke the following
main.py --createFolder Tesfolder --path C://Test/Test/...
How to read these arguments? I can get optparser to work for single argument,like this
c = cfgparse.ConfigParser()
c.add_file('name_dest.ini')
c.add_option('mail_server')
c.add_option('proxy_server', dest='proxy')
opts = c.parse()
but not with multiple args any help is appreciated
thanks
starzstar
Python Fan
Posts: 5
Joined: Tue Jan 20, 2009 4:39 am
Top
•
•
Join Date: Feb 2009
Posts: 2
Reputation:
Solved Threads: 0
Pls help me.....
Pls reply 2 my mail id tokeerthi85@gmail.com
Hi,
I was doing simple Binary search Program on N elements..
I got a idea to do Testing on this..
Can any one help me has i dont know abt testing..
how many test cases required for 4 elements, has the elements grow till N then how many tests required.... Pls Help me......
Pls reply 2 my mail id tokeerthi85@gmail.com
Hi,
I was doing simple Binary search Program on N elements..
I got a idea to do Testing on this..
Can any one help me has i dont know abt testing..
how many test cases required for 4 elements, has the elements grow till N then how many tests required.... Pls Help me......
•
•
Join Date: May 2008
Posts: 556
Reputation:
Solved Threads: 90
@starzstar
I think the module you're looking for it getopt
It is designed to parse command line arguments and handles the type you indicated.
@keerthihm
You should probably have started your own thread and not replied to this one.
You seem to be asking about testing a binary tree.
Which are you wanting?
I think the module you're looking for it getopt
It is designed to parse command line arguments and handles the type you indicated.
@keerthihm
You should probably have started your own thread and not replied to this one.
You seem to be asking about testing a binary tree.
Which are you wanting?
- help testing a binary tree algorithm
- help calculating the number of comparisons that must be made when searching a binary tree
![]() |
Similar Threads
- libgpod3 + gtkpod (*nix Software)
- Searching tutorial on html editing to build website (HTML and CSS)
- GTKpod (*nix Software)
- error C2375: 'my_strdup' : redefinition; different linkage (C++)
- Unknown Virus (Viruses, Spyware and other Nasties)
- I've got Trojan.Holax... is this bad? (Viruses, Spyware and other Nasties)
- not-a-virusadware (Viruses, Spyware and other Nasties)
Other Threads in the Python Forum
- Previous Thread: fadic addition using Python.
- Next Thread: help!!!
| Thread Tools | Search this Thread |
address alarm anydbm app beginner cipher coordinates curves cx-freeze data development dictionary directory dynamic examples excel feet file float format function generator getvalue gui halp handling homework images import input ip itunes java keycontrol line linux list lists loop maintain maze millimeter mouse mysqldb number numbers output parsing path port prime programming projects py2exe pygame pyglet pymailer python queue random recursion recursive screensaverloopinactive script scrolledtext searchingfile shebang slicenotation split ssh string strings table terminal text thread threading time tkinter tlapse tooltip tuple tutorial type ubuntu unicode url urllib urllib2 variable variables ventrilo verify vigenere web webservice windows wx.wizard wxpython xlwt





