Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed4.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.196 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.65; '*S*': 0.05; 'subject:: [': 0.04; 'exit': 0.09; 'wrote:': 0.18; 'subject:] ': 0.20; 'header:User- Agent:1': 0.23; 'subject:problem': 0.24; 'header:In-Reply-To:1': 0.27; 'code': 0.31; 'jean': 0.31; 'problem': 0.35; 'subject:with': 0.35; 'agree': 0.35; 'really': 0.36; 'hi,': 0.36; 'received:10': 0.37; 'to:addr:python-list': 0.38; 'to:addr:python.org': 0.39; 'either': 0.39; 'chain': 0.60; 'commands': 0.60; 'here': 0.66; 'url:be': 0.68; 'yours': 0.88; 'albert': 0.91; 'shell,': 0.91 X-Virus-Scanned: Debian amavisd-new at free-minds.net User-Agent: K-9 Mail for Android In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: Re: [newbie] problem with if then From: Albert Dengg Date: Sun, 09 Jun 2013 22:37:09 +0200 To: python-list@python.org 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: 14 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1370810586 news.xs4all.nl 16011 [2001:888:2000:d::a6]:60200 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47492 Jean Dubois wrote: ... > checkavailablestring='wget -q -O - >http://www.deredactie.be/cm/vrtnieuws/videozone/programmas/journaal/EP_'+thisday.strftime("%y%m%d")+'_JO7 >>/dev/null ; echo $?' The problem schould be the echo: Since os.system returns the exit code of the shell, when chaining commands with ; it returns the exit status of the last command,in your case the echo. So,if you really want to go with wget here, Either drop the echo or chain with && Yours Albert Hi, While i agree that calling wget here is not optimal....