Path: csiph.com!usenet.pasdenom.info!goblin1!goblin2!goblin.stu.neva.ru!newsfeed.xs4all.nl!newsfeed2a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!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.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'from:addr:yahoo.co.uk': 0.04; 'append': 0.09; 'check,': 0.09; 'lawrence': 0.09; 'received:80.91': 0.09; 'received:80.91.229': 0.09; 'received:gmane.org': 0.09; 'received:list': 0.09; 'wrote': 0.14; 'anyway': 0.14; 'language.': 0.14; 'indexerror:': 0.16; 'programmer,': 0.16; 'received:80.91.229.3': 0.16; 'received:plane.gmane.org': 0.16; 'spacing': 0.16; 'subject:variable': 0.16; 'index': 0.16; 'prevent': 0.16; 'language': 0.16; 'wrote:': 0.18; 'code.': 0.18; 'thanks.': 0.20; '>>>': 0.22; 'header:User-Agent:1': 0.23; '---': 0.24; 'header:X -Complaints-To:1': 0.27; 'header:In-Reply-To:1': 0.27; 'sets': 0.30; 'getting': 0.31; "skip:' 10": 0.31; 'tool': 0.35; 'test': 0.35; 'but': 0.35; 'there': 0.35; 'list': 0.37; 'to:addr:python- list': 0.38; 'to:addr:python.org': 0.39; 'received:org': 0.40; 'how': 0.40; 'remove': 0.60; 'dave': 0.60; 'free': 0.61; 'viruses': 0.61; 'range': 0.61; 'course': 0.61; "you're": 0.61; 'email addr:gmail.com': 0.63; 'protection': 0.63; 'our': 0.64; 'antivirus': 0.68; 'received:2': 0.84 X-Injected-Via-Gmane: http://gmane.org/ To: python-list@python.org From: Mark Lawrence Subject: Re: Flag control variable Date: Wed, 12 Feb 2014 15:42:37 +0000 References: <68f27949-e613-476b-9227-5a86e4f4df91@googlegroups.com> <9335871e-e4a5-4bdf-92de-72ac7f20a722@googlegroups.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gmane-NNTP-Posting-Host: host-2-98-192-220.as13285.net User-Agent: Mozilla/5.0 (Windows NT 6.1; rv:24.0) Gecko/20100101 Thunderbird/24.3.0 In-Reply-To: <9335871e-e4a5-4bdf-92de-72ac7f20a722@googlegroups.com> X-Antivirus: avast! (VPS 140212-0, 12/02/2014), Outbound message X-Antivirus-Status: Clean X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 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: 54 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1392219909 news.xs4all.nl 2849 [2001:888:2000:d::a6]:57532 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:66048 On 12/02/2014 15:32, luke.geelen@gmail.com wrote: > Op woensdag 12 februari 2014 06:23:14 UTC+1 schreef Dave Angel: >> luke.geelen@gmail.com Wrote in message: >> >>> Can I make it that if >> >>> C = int(sys.argv[3]) >> >>> But when I only enter 2 argumentvariable it sets c automaticly to 0 or 1 >> >>> >> >> >> >> Why do you ask for 'automatically'? You're the programmer, write >> >> the test in the code. >> >> >> >> if len (sys.argv) == 3: >> >> sys.argv. append ("0") >> >> >> >> But of course there are lots of other things you need to check, >> >> so consider all of them at the same time. >> >> >> >> -- >> >> DaveA > > then i keep getting IndexError: list index out of range > anyway to prevent it and just set the value to 0? > Please find a semi-decent tool to use or always follow the instructions for how to remove the double line spacing when using gg, thanks. -- My fellow Pythonistas, ask not what our language can do for you, ask what you can do for our language. Mark Lawrence --- This email is free from viruses and malware because avast! Antivirus protection is active. http://www.avast.com