Re: [newbie] problem with if then

2013-06-09 Thread Albert Dengg
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 comma

Re: [newbie] problem with if then

2013-06-09 Thread Roy Smith
In article , Jean Dubois wrote: > I'm writing some code to check whether an url is available or not, > therefore I make use of a wget-command in Linux and then check whether > this is successful In general, "shelling out" to run a command-line utility should be the last resort. It's slower,

Re: [newbie] problem with if then

2013-06-09 Thread Fábio Santos
On 9 Jun 2013 20:49, "Jean Dubois" wrote: > > I'm writing some code to check whether an url is available or not, > therefore I make use of a wget-command in Linux and then check whether > this is successful (returning a 0) or not returning an 8 > However the if then statement seems to give the sam

[newbie] problem with if then

2013-06-09 Thread Jean Dubois
I'm writing some code to check whether an url is available or not, therefore I make use of a wget-command in Linux and then check whether this is successful (returning a 0) or not returning an 8 However the if then statement seems to give the same result in both cases: Here is my code: #!/usr/bin/