Linux Today: Linux News On Internet Time.
Search Linux Today
search.internet.com
Linux News Sections:  Blog -  Developer -  High Performance -  Infrastructure -  IT Management -  Security -  Storage -
Linux Today Navigation
LT Home
Preferences
Contribute
Link to Us
Search
Linux Jobs

Become a Marketplace Partner

internet.commerce
Be a Commerce Partner














The Linux Channel at internet.com
Linux Today
Enterprise Linux Today
Apache Today
JustLinux.com
Linux Planet
PHPBuilder
All Linux Devices
Technology Jobs

JustTechJobs.com

LinuxToday Newsletters
Subscribe News
Subscribe PR
Subscribe Security

internet.com
IT
Developer
Internet News
Small Business
Personal Technology

Search internet.com
Advertise
Corporate Info
Newsletters
Tech Jobs
E-mail Offers

 






Current Newswire:

Debian Project Pleased with Ten Times Faster Build Server

Dell bars Win 7 refunds from Linux lovers

This is not a democracy (Ubuntu)

Cool: smallest Linux desktop PC, smaller than an apple (fruit)

Alternative Unix Software Installation Methods

Weekly Ten: Programming Is the New Literacy, Mario Goes Open-Source, Ubuntu Dumps

An example of the awesomeness of the open source community

Berry Linux 1.01 Is Based on Fedora 12

Red Hat CEO Says Innovation Trumps Cost Savings

Hacker Disables More Than 100 Cars Remotely




Sr Implementation Engineer –Networking (CO)
Next Step Systems
US-CO-Thornton

Justtechjobs.com Post A Job | Post A Resume
:Building Command Line Utilities with Python
Building Command Line Utilities with Python
Nov 11, 2008, 21 :34 UTC (0 Talkback[s]) (3717 reads)

(Other stories by Jeremy M. Jones)

"The command line arguments are treated as a list, which is accessible by referencing sys.argv. The first element of the list is the name of the script and the remaining elements are the arguments passed in after the script name. If I wanted to, I could figure out what options I wanted to take, iterate through sys.argv, and map what the user gave me to the options I wanted to handle. I could do that, but it would be wasted time.

"There is a better way. A much better way. It's called optparse.

"With optparse, you declaratively build up an option parser by adding the behavior you want it to exhibit when it sees various options. Here's a simple example of a script that uses optparse."

Complete Story

Related Stories:
4 Open Source Code Review Tools(Nov 11, 2008)
Comparison of Python virtual machines(Nov 09, 2008)
Python Data Persistence Using MySQL(Oct 31, 2008)
Python 3.0 Makes a Big Break(Oct 17, 2008)
Python's New Release Bridges the Gap(Oct 03, 2008)
Automation with Python and STAF/STAX(Sep 23, 2008)
With EasyGUI, I Can Stick with Python(Sep 14, 2008)
The A-Z of Programming Languages: Python(Aug 08, 2008)



No talkbacks posted.
  Home | Search Talkbacks | Customize View    Top of Page  



Enter your comments below:

* Your Name:

* Your Email Address:

* Subject:

CC: [will also send this talkback to an E-Mail address]

* Comments:

Tags allowed:<I>,<B> and <U>. See our talkback-policy for more about talkback content.

Fields marked with * are required!






..............................




All times are recorded in UTC.
Linux is a trademark of Linus Torvalds.
Powered by Linux, Apache and PHP


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers