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


Groups > comp.lang.python > #65950

Re: Flag control variable

Path csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed3.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail
Return-Path <gary.herron@islandtraining.com>
X-Original-To python-list@python.org
Delivered-To python-list@mail.python.org
X-Spam-Status OK 0.005
X-Spam-Evidence '*H*': 0.99; '*S*': 0.00; '(at': 0.04; 'odd': 0.07; 'string': 0.09; 'converted': 0.09; 'received:67.192': 0.09; 'received:67.192.241': 0.09; 'received:dfw.emailsrvr.com': 0.09; 'so?': 0.09; 'python': 0.11; '10:59': 0.16; 'integer.': 0.16; 'least)': 0.16; 'script,': 0.16; 'subject:variable': 0.16; 'wrote:': 0.18; 'value.': 0.19; 'not,': 0.20; 'command': 0.22; 'header:User-Agent:1': 0.23; 'error': 0.23; 'expanded': 0.24; 'received:emailsrvr.com': 0.24; 'question': 0.24; 'received:(smtp server)': 0.26; 'skip:" 30': 0.26; 'least': 0.26; 'values': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'character': 0.29; '(on': 0.31; 'gary': 0.31; 'run': 0.32; 'quite': 0.32; 'linux': 0.33; 'becomes': 0.33; 'trouble': 0.34; 'message.': 0.35; "can't": 0.35; 'problem.': 0.35; 'something': 0.35; 'usual': 0.35; 'but': 0.35; "didn't": 0.36; 'list': 0.37; 'being': 0.38; 'to:addr :python-list': 0.38; 'files': 0.38; 'that,': 0.38; 'does': 0.39; 'to:addr:python.org': 0.39; 'how': 0.40; 'is.': 0.60; 'most': 0.60; 'tell': 0.60; 'course': 0.61; "you'll": 0.62; 'email addr:gmail.com': 0.63; 'such': 0.63; 'manner': 0.72; 'us,': 0.73; 'asterisk': 0.84
X-Virus-Scanned OK
Date Tue, 11 Feb 2014 11:09:22 -0800
From Gary Herron <gary.herron@islandtraining.com>
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0
MIME-Version 1.0
To python-list@python.org
Subject Re: Flag control variable
References <baffb663-4f6d-4580-ac5d-d99b4aaf3c40@googlegroups.com> <5019eb5d-ebda-4417-ab2d-9a58afcdd186@googlegroups.com> <mailman.6694.1392144984.18130.python-list@python.org> <b31d9efd-11c0-410a-88b9-7774c0318c6a@googlegroups.com>
In-Reply-To <b31d9efd-11c0-410a-88b9-7774c0318c6a@googlegroups.com>
Content-Type text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding 7bit
X-BeenThere python-list@python.org
X-Mailman-Version 2.1.15
Precedence list
List-Id General discussion list for the Python programming language <python-list.python.org>
List-Unsubscribe <https://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 <https://mail.python.org/mailman/listinfo/python-list>, <mailto:python-list-request@python.org?subject=subscribe>
Newsgroups comp.lang.python
Message-ID <mailman.6696.1392145780.18130.python-list@python.org> (permalink)
Lines 41
NNTP-Posting-Host 2001:888:2000:d::a6
X-Trace 1392145780 news.xs4all.nl 2943 [2001:888:2000:d::a6]:45070
X-Complaints-To abuse@xs4all.nl
Xref csiph.com comp.lang.python:65950

Show key headers only | View raw


On 02/11/2014 10:59 AM, luke.geelen@gmail.com wrote:
>
>
> Look at the error message.  Carefully!  It says, quite clearly, the call
>
> to int is being passed a string "Adafruit-Raspberry-Pi-Python-Code",
>
> which of course can't be converted to an integer.
>
>
>
> Now the question is how you ran the program in such a manner that
>
> sys.argv[3] has such an odd value.
>
> What does your command line look like?  You didn't tell us, but that's
>
> where the trouble is.
>
>
>
> Gary Herron
> how do you meen "what does your command line look like?"

When you run this python script,  *how* do you do so?

Perhaps you type something like:
   python script.py 21 '*' 42
If not, then how do you supply values for the script's sys.argv?

If it is like that, then I see the most likely potential problem. The 
asterisk character (on Linux at least) is considered a wild-card 
character -- it is replaced by a list of local files so your command becomes
   python script.py 21 somefile1 somefile2 somefile3 <...and so on.> 42

If you put it in quotes, then it won't be expanded  (at least in the 
usual Linux shells -- you system may vary) and you'll end up with the 
asterisk in sys.argv[2] and the number in sys.argv[3].

Gary Herron

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


Thread

Flag control variable luke.geelen@gmail.com - 2014-02-11 09:29 -0800
  Re: Flag control variable Larry Martell <larry.martell@gmail.com> - 2014-02-11 12:44 -0500
  Re: Flag control variable Peter Otten <__peter__@web.de> - 2014-02-11 18:46 +0100
  Re: Flag control variable luke.geelen@gmail.com - 2014-02-11 10:00 -0800
  Re: Flag control variable luke.geelen@gmail.com - 2014-02-11 10:16 -0800
    Re: Flag control variable Tim Chase <python.list@tim.thechases.com> - 2014-02-11 12:32 -0600
  Re: Flag control variable luke.geelen@gmail.com - 2014-02-11 10:37 -0800
    Re: Flag control variable Tim Chase <python.list@tim.thechases.com> - 2014-02-11 12:51 -0600
    Re: Flag control variable Peter Otten <__peter__@web.de> - 2014-02-11 19:51 +0100
      Re: Flag control variable luke.geelen@gmail.com - 2014-02-11 11:01 -0800
        Re: Flag control variable luke.geelen@gmail.com - 2014-02-11 11:06 -0800
          Re: Flag control variable Gary Herron <gary.herron@islandtraining.com> - 2014-02-11 11:26 -0800
          Re: Flag control variable Tim Chase <python.list@tim.thechases.com> - 2014-02-11 13:28 -0600
            Re: Flag control variable luke.geelen@gmail.com - 2014-02-11 11:54 -0800
              Re: Flag control variable Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-11 20:02 +0000
        Re: Flag control variable Jussi Piitulainen <jpiitula@ling.helsinki.fi> - 2014-02-11 21:14 +0200
        Re: Flag control variable Gary Herron <gary.herron@islandtraining.com> - 2014-02-11 11:20 -0800
    Re: Flag control variable Gary Herron <gary.herron@islandtraining.com> - 2014-02-11 10:55 -0800
      Re: Flag control variable luke.geelen@gmail.com - 2014-02-11 10:59 -0800
        Re: Flag control variable Gary Herron <gary.herron@islandtraining.com> - 2014-02-11 11:09 -0800
        Re: Flag control variable Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-11 19:08 +0000
  Re: Flag control variable luke.geelen@gmail.com - 2014-02-11 11:55 -0800
    Re: Flag control variable Gary Herron <gary.herron@islandtraining.com> - 2014-02-11 12:19 -0800
      Re: Flag control variable luke.geelen@gmail.com - 2014-02-11 13:18 -0800
        Re: Flag control variable Gary Herron <gary.herron@islandtraining.com> - 2014-02-11 15:47 -0800
          Re: Flag control variable luke.geelen@gmail.com - 2014-02-11 21:09 -0800
            Re: Flag control variable Dave Angel <davea@davea.name> - 2014-02-12 00:23 -0500
              Re: Flag control variable luke.geelen@gmail.com - 2014-02-12 07:32 -0800
                Re: Flag control variable Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-02-12 15:42 +0000
                Re: Flag control variable Dave Angel <davea@davea.name> - 2014-02-12 13:51 -0500
            Re: Flag control variable Alain Ketterlin <alain@dpt-info.u-strasbg.fr> - 2014-02-12 17:10 +0100
              Re: Flag control variable luke.geelen@gmail.com - 2014-02-12 09:15 -0800
            Re: Flag control variable Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2014-02-12 20:46 -0500

csiph-web