Re: Command Line was: python

  • From: Daniel Dalton <d.dalton@xxxxxxxxxxxx>
  • To: blind programming <programmingblind@xxxxxxxxxxxxx>
  • Date: Tue, 13 May 2008 08:19:17 +1000 (EST)

Hi Richard,

I'm reading dive into python actually. So will look at the chapter on cmd arguments.
I'll also google for some information as you suggested.
Is doing command line arguments the same on windows and linux?
I don't know how the cmd line on windows works.

Thanks!


On Mon, 12 May 2008, rrdinger wrote:

If you google "python command line arguments" you will find a few interesting items.

You may be interested in the getopt module or the optparse module in the standard library.

See also Dive into Python chapter 5 on-line.

Richard
----- Original Message ----- From: "Daniel Dalton" <d.dalton@xxxxxxxxxxxx>
To: "blind programming" <programmingblind@xxxxxxxxxxxxx>
Sent: Monday, May 12, 2008 12:20 AM
Subject: python


Hi,

I have been teaching myself python and have a few questions:

1. Does anyone know of a good book on classes, the try statement and the more advanced things in python?
2. What is the best way of handling command line arguments?
So far I have been doing:

import sys
for i in sys.argv[1:]:
    if i == "-b":
        do something
    elif i == "whatever":
        do something else.

Sorry if my indenting is wrong, no braille here.
But just using a loop to go through the argvs, check what it is and do a certain thing.
Is there a cleaner/easier way than this?
3. Where is the best place to learn apis such as gtk and any I may need to know for linux programming and general python stuff? 4. Does anyone know of a book that could teach me the more advanced things as wells as review the basics in python? (I have a reasonable understanding of python...)

Any help is greatly appreciated.

Cheers,



--
Daniel Dalton

http://members.iinet.net.au/~ddalton/
<d.dalton@xxxxxxxxxxxx>
__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind



__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind


--
Daniel Dalton

http://members.iinet.net.au/~ddalton/
<d.dalton@xxxxxxxxxxxx>
__________
View the list's information and change your settings at //www.freelists.org/list/programmingblind

Other related posts: