Path: csiph.com!v102.xanadu-bbs.net!xanadu-bbs.net!feeder.erje.net!eu.feeder.erje.net!newsfeed.xs4all.nl!newsfeed2.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.131 X-Spam-Level: * X-Spam-Evidence: '*H*': 0.75; '*S*': 0.01; 'cc:addr:python-list': 0.11; 'code.': 0.18; 'command': 0.22; 'cc:addr:python.org': 0.22; 'instead.': 0.24; 'subject:problem': 0.24; 'cc:2**0': 0.24; 'cc:no real name:2**0': 0.24; '>': 0.26; 'header:In-Reply-To:1': 0.27; 'message-id:@mail.gmail.com': 0.30; 'problem': 0.35; 'subject:with': 0.35; 'received:209.85': 0.35; 'received:google.com': 0.35; 'returning': 0.36; 'should': 0.36; 'received:209': 0.37; 'skip:& 10': 0.38; 'to:addr:gmail.com': 0.65; 'here': 0.66; 'url:be': 0.68; '2013': 0.98 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=kOBZfzaC0YUtPrID2Ayh2kJnQJYz8LKaGi1g8zLLVGM=; b=OtwF17g+Lz2yvmBK/x1gRZTwOrUN9Lnu25EBEHyDPB+Bw5ADMXoXndcrGdhBidPkQB f2k5XhMi6Py+Ih2COvftutGdBuhtVkHPBGN3vaM7h0B75afvuxIWidOsIhPROCBgx6pq 4KCwYur8SoD4/POJqG5mSMgck5jmoUdbENYHKY6QFS2MaoTkywxTM5Qphq9OkpfOz1tP DYsA8GeLJwV5N4CYsG9oGZ2jjQ5t4clsAcv2MTo8gKYMvSyslKBniCqR7/qNgSzp97ov EVZ67KEevpkgPOBIYElH8Ij9u55hh0gHo+ZKYTyXZZ52PDADFLDUduIBv6BbuZQ4Di4k ZNmA== MIME-Version: 1.0 X-Received: by 10.49.5.8 with SMTP id o8mr8335023qeo.1.1370809781058; Sun, 09 Jun 2013 13:29:41 -0700 (PDT) In-Reply-To: <2cb97d50-87b1-4173-a4d9-0cb4342bfd5f@g2g2000vbk.googlegroups.com> References: <2cb97d50-87b1-4173-a4d9-0cb4342bfd5f@g2g2000vbk.googlegroups.com> Date: Sun, 9 Jun 2013 21:29:40 +0100 Subject: Re: problem with if then From: =?ISO-8859-1?Q?F=E1bio_Santos?= To: Jean Dubois Content-Type: multipart/alternative; boundary=047d7bdc9ca60e122a04debe868b Cc: 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: 58 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1370809789 news.xs4all.nl 15922 [2001:888:2000:d::a6]:52831 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:47490 --047d7bdc9ca60e122a04debe868b Content-Type: text/plain; charset=ISO-8859-1 On 9 Jun 2013 21:24, "Jean Dubois" ... > And here is the result: > > jean@antec4:~$ ./try.py > wget -q -O - http://www.deredactie.be/cm/vrtnieuws/videozone/programmas/journaal/EP_130607_JO7 > >/dev/null ; echo $? > 8 > 2013-06-07 22:07:00.016807 stream is available > wget -q -O - http://www.deredactie.be/cm/vrtnieuws/videozone/programmas/journaal/EP_130608_JO7 > >/dev/null ; echo $? > 8 > 2013-06-08 22:07:00.016795 stream is available > wget -q -O - http://www.deredactie.be/cm/vrtnieuws/videozone/programmas/journaal/EP_130609_JO7 > >/dev/null ; echo $? > 0 > 2013-06-09 22:07:00.016763 stream is available > You don't need to echo the return code. os.system should return that as an int. The problem might be that os.system is returning the result from the echo command instead. --047d7bdc9ca60e122a04debe868b Content-Type: text/html; charset=ISO-8859-1


On 9 Jun 2013 21:24, "Jean Dubois"
...
> And here is the result:
>
> jean@antec4:~$ ./try.py
> wget -q -O - http://www.deredactie.be/cm/vrtnieuws/videozone/programmas/journaal/EP_130607_JO7
> >/dev/null ; echo $?
> 8
> 2013-06-07 22:07:00.016807 stream is available
> wget -q -O - http://www.deredactie.be/cm/vrtnieuws/videozone/programmas/journaal/EP_130608_JO7
> >/dev/null ; echo $?
> 8
> 2013-06-08 22:07:00.016795 stream is available
> wget -q -O - http://www.deredactie.be/cm/vrtnieuws/videozone/programmas/journaal/EP_130609_JO7
> >/dev/null ; echo $?
> 0
> 2013-06-09 22:07:00.016763 stream is available
>

You don't need to echo the return code. os.system should return that as an int.

The problem might be that os.system is returning the result from the echo command instead.

--047d7bdc9ca60e122a04debe868b--