Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!aioe.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed6.news.xs4all.nl!xs4all!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.025 X-Spam-Evidence: '*H*': 0.95; '*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; 'soap,': 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; 'sunday,': 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; 'thanks': 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; 'enough': 0.38; 'should': 0.39; 'help': 0.39; 'subject:: ': 0.39; 'did': 0.40; 'user': 0.40; '2011': 0.62; 'header:Message-Id:1': 0.62; 'link': 0.63; 'instantly': 0.67; 'show': 0.67; 'greetings': 0.74; '"there': 0.84; 'best?': 0.84; 'error-free.': 0.84; 'me:': 0.84; 'nss': 0.84; 'received:66.118': 0.91 X-Spam-Status: No, score=-2.1 required=5.0 X-Spam-Level: From: gene heskett To: d@davea.name Subject: Re: Python lesson please Date: Sun, 6 Nov 2011 18:10:03 -0500 User-Agent: KMail/1.13.7 (Linux/2.6.38.8-pclos2.pae.bfs; KDE/4.6.5; i686; ; ) References: <201111061314.43744.gheskett@wdtv.com> <4EB6EC38.20708@davea.name> In-Reply-To: <4EB6EC38.20708@davea.name> MIME-Version: 1.0 Content-Type: Text/Plain; charset="windows-1256" Content-Transfer-Encoding: 7bit Cc: python-list@python.org X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 48 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1320621009 news.xs4all.nl 6981 [2001:888:2000:d::a6]:53885 X-Complaints-To: abuse@xs4all.nl Xref: x330-a1.tempe.blueboxinc.net comp.lang.python:15393 On Sunday, November 06, 2011 06:07:36 PM Dave Angel did opine: > 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? It has no --help: [root@coyote gene]# ./duqu-drivers-detect.py --help [root@coyote gene]# Sorry. Thanks & Cheers, Gene -- "There are four boxes to be used in defense of liberty: soap, ballot, jury, and ammo. Please use in that order." -Ed Howdershelt (Author) My web page: Expedience is the best teacher.