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


Groups > comp.lang.python > #47492

Re: [newbie] problem with if then

References <cd1be83a-f560-4024-90b3-697a51bb1bb0@g7g2000vbv.googlegroups.com>
Subject Re: [newbie] problem with if then
From Albert Dengg <albert@fsfe.org>
Date 2013-06-09 22:37 +0200
Newsgroups comp.lang.python
Message-ID <mailman.2937.1370810586.3114.python-list@python.org> (permalink)

Show all headers | View raw


Jean Dubois <jeandubois314@gmail.com> 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....

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


Thread

[newbie] problem with if then Jean Dubois <jeandubois314@gmail.com> - 2013-06-09 12:44 -0700
  Re: [newbie] problem with if then Fábio Santos <fabiosantosart@gmail.com> - 2013-06-09 21:00 +0100
    Re: problem with if then Jean Dubois <jeandubois314@gmail.com> - 2013-06-09 13:15 -0700
      Re: problem with if then Fábio Santos <fabiosantosart@gmail.com> - 2013-06-09 21:29 +0100
        Re: problem with if then Jean Dubois <jeandubois314@gmail.com> - 2013-06-09 13:51 -0700
  Re: [newbie] problem with if then Roy Smith <roy@panix.com> - 2013-06-09 16:23 -0400
    Re: problem with if then Jean Dubois <jeandubois314@gmail.com> - 2013-06-09 14:00 -0700
      Re: problem with if then Roy Smith <roy@panix.com> - 2013-06-09 17:35 -0400
        Re: problem with if then Jean Dubois <jeandubois314@gmail.com> - 2013-06-10 00:46 -0700
  Re: [newbie] problem with if then Albert Dengg <albert@fsfe.org> - 2013-06-09 22:37 +0200

csiph-web