Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > process command line parameter

Reply
Thread Tools

process command line parameter

 
 
asit
Guest
Posts: n/a
 
      01-17-2009
Recently I was coding a link extractor. It's a command line stuff and
takes parameter as argument.
I found that the in operator is not always helpful.
eg. if "--all" in sys.argv:
print "all links will be printed"

its not helpful when some attribute value is sent in command line
parameter.
hence I want to process some data like find=".co.uk"

How can i do this ???
 
Reply With Quote
 
 
 
 
Thorsten Kampe
Guest
Posts: n/a
 
      01-18-2009
* asit (Sat, 17 Jan 2009 13:28:12 -0800 (PST))
> Recently I was coding a link extractor. It's a command line stuff and
> takes parameter as argument.
> I found that the in operator is not always helpful.
> eg. if "--all" in sys.argv:
> print "all links will be printed"
>
> its not helpful when some attribute value is sent in command line
> parameter.
> hence I want to process some data like find=".co.uk"
>
> How can i do this ???


Use optparse
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Modelsim command line: How to pass a generic parameter for my testbench ? tarekeldeeb VHDL 4 03-10-2009 02:53 PM
py2exe, command line parameter problem Karsten W. Python 0 08-09-2007 02:54 PM
passing parameter to WATIR through command line curious Ruby 1 10-29-2006 06:55 PM
Command line options: using an [option: parameter] without a parameter passed to it soren625 Perl Misc 10 12-28-2005 09:26 PM
How to stop java service with command line parameter '-stop'? Will Java 1 11-02-2004 03:32 PM



Advertisments