943,741 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 1006
  • Python RSS
Feb 6th, 2009
0

Option parser help needed

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
starzstar is offline Offline
19 posts
since Jan 2009
Feb 6th, 2009
0

Re: Option parser help needed

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......
Reputation Points: 10
Solved Threads: 0
Newbie Poster
keerthihm is offline Offline
2 posts
since Feb 2009
Feb 6th, 2009
0

Re: Option parser help needed

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......
Reputation Points: 10
Solved Threads: 0
Newbie Poster
keerthihm is offline Offline
2 posts
since Feb 2009
Feb 7th, 2009
0

Re: Option parser help needed

Maybe I am not alone, but I could not get the problem.
Please provide some simplified cases of what you want to achieve.

Please use code tags and punctuation.
Reputation Points: 56
Solved Threads: 65
Posting Whiz in Training
slate is offline Offline
242 posts
since Jun 2008
Feb 7th, 2009
1

Re: Option parser help needed

@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?
  • help testing a binary tree algorithm
  • help calculating the number of comparisons that must be made when searching a binary tree
Reputation Points: 344
Solved Threads: 116
Practically a Master Poster
Murtan is offline Offline
670 posts
since May 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: fadic addition using Python.
Next Thread in Python Forum Timeline: help!!!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC