python getopt functionality

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • M.N.A.Smadi

    #1

    python getopt functionality

    hi;

    I have a perl script that I need to port to python. The script takes
    input from the command line. Is there a standard way of processing
    command line arguments based on the -flag preceeding the argument?

    thanks
    moe smadi
  • Michael

    #2
    Re: python getopt functionality

    M.N.A.Smadi wrote:
    [color=blue]
    > I have a perl script that I need to port to python. The script takes
    > input from the command line. Is there a standard way of processing
    > command line arguments based on the -flag preceeding the argument?[/color]

    Yes.

    # pydoc getopt
    Help on module getopt:

    NAME
    getopt - Parser for command line options.

    FILE
    /usr/lib/python2.4/getopt.py

    MODULE DOCS

    [ ... snip ... ]


    Michael

    Comment

    Working...