Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #15389

Re: Python lesson please

Path csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder1.news.weretis.net!feeder.erje.net!newsfeed.xs4all.nl!newsfeed5.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <d@davea.name>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.018
X-Spam-Evidence '*H*': 0.96; '*S*': 0.00; 'else:': 0.03; 'subject:Python': 0.06; 'python': 0.08; 'linux.': 0.09; 'argument': 0.15; 'cc:addr:python-list': 0.15; '--help': 0.16; 'finder': 0.16; 'gene': 0.16; 'received:192.168.1.104': 0.16; 'linux': 0.17; 'cheers,': 0.18; 'wrote:': 0.18; 'driver': 0.18; 'cc:no real name:2**0': 0.21; 'subject:please': 0.21; 'runs': 0.23; 'indentation': 0.23; 'header:In-Reply-To:1': 0.23; 'suspect': 0.24; 'cc:2**0': 0.25; 'thanks.': 0.26; 'script': 0.28; 'fixed': 0.28; 'looks': 0.28; 'fix': 0.29; 'cc:addr:python.org': 0.29; 'least': 0.31; 'pm,': 0.31; 'does': 0.32; "isn't": 0.32; 'header:User-Agent:1': 0.33; 'probably': 0.34; 'null': 0.34; 'assuming': 0.36; 'but': 0.37; 'skip:t 50': 0.38; 'run': 0.38; 'received:192': 0.38; 'enough': 0.38; 'should': 0.39; 'help': 0.39; 'subject:: ': 0.39; 'user': 0.40; 'link': 0.63; 'instantly': 0.67; 'show': 0.67; 'header:Reply-To:1': 0.70; 'reply-to:no real name:2**0': 0.71; 'greetings': 0.74; 'best?': 0.84; 'error-free.': 0.84; 'me:': 0.84; 'nss': 0.84
Date Sun, 06 Nov 2011 15:21:12 -0500
From Dave Angel <d@davea.name>
User-Agent Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.23) Gecko/20110922 Thunderbird/3.1.15
MIME-Version 1.0
To gene heskett <gheskett@wdtv.com>
Subject Re: Python lesson please
References <201111061314.43744.gheskett@wdtv.com>
In-Reply-To <201111061314.43744.gheskett@wdtv.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-Provags-ID V02:K0:S1E43e804MytthM8u1Ws5lqGLelw7rr3WsvWMzfx2Pt JFqAaLg+twFux8PLlJo2R32NA4g9CHqBAhOgFVHPSXqoetrIwU 93QjqdIRwtLAiqIjBY2/s1XlLaAgEQlUqFwB7UuB7it8SRioNJ nNxA9XU1KIoZUNHRJP7PgOQCtn1AD7V1cih+ZeanZIgbF9ptqe cDgcoRAZbTeWhNnHoNT3R5KF1s56GL/Iuj9L6Tp422iFQqMwiw C/93Ql8D+gjJknoVDPhX7q7+55WCNI46nop7ja23Bn/caxh+NA /LmUR0tgVrXGXq3pcOiIcae2eg7yuC0S9jJal11KVB4FlzzHA= =
Cc python-list@python.org
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.12
Precedence list
Reply-To d@davea.name
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <http://mail.python.org/mailman/options/python-list>, <mailto:python-list-request@python.org?subject=unsubscribe>
List-Archive <http://mail.python.org/pipermail/python-list>
List-Post <mailto:python-list@python.org>
List-Help <mailto:python-list-request@python.org?subject=help>
List-Subscribe <http://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.2473.1320610922.27778.python-list@python.org> (permalink)
Lines 37
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1320610922 news.xs4all.nl 6876 [2001:888:2000:d::a6]:52931
X-Complaints-To abuse@xs4all.nl
Xref x330-a1.tempe.blueboxinc.net comp.lang.python:15389

Show key headers only | View raw


On 11/06/2011 01:14 PM, gene heskett wrote:
> Greetings experts:
>
> I just dl'd the duqu driver finder script from a link to NSS on /., and
> fixed enough of the tabs in it to make it run error-free.  At least python
> isn't having a litter of cows over the indentation now.
>
> But it also runs instantly on linux.
>
> This line looks suspect to me:
>   rootdir = sys.argv[1]
>
> And I have a suspicion it is null on a linux box.
>
> How can I fix that best?
>
> Thanks.
>
> Cheers, Gene

Nothing wrong with that line, assuming the user of the script happened 
to provide an argument for rootpath.  Probably it should be preceded by 
a a conditional:

     if len(argv) <2:
            tell.user.that.she's.missing.the.rootdir.parameter
      else:
            rootdir = sys.argv[1]
            etc.

What does the help text show when you run the script with the --help 
argument?

-- 

DaveA

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: Python lesson please Dave Angel <d@davea.name> - 2011-11-06 15:21 -0500

csiph-web