[newbie] problem with if then

Albert Dengg albert at fsfe.org
Sun Jun 9 16:37:09 EDT 2013


Jean Dubois <jeandubois314 at 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....



More information about the Python-list mailing list