problem with if then

Fábio Santos fabiosantosart at gmail.com
Sun Jun 9 16:29:40 EDT 2013


On 9 Jun 2013 21:24, "Jean Dubois"
...
> And here is the result:
>
> jean at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130609/1f7e49d2/attachment.html>


More information about the Python-list mailing list