[newbie] problem with if then

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


On 9 Jun 2013 20:49, "Jean Dubois" <jeandubois314 at gmail.com> 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 same result in both
> cases:

Which result? Failure, or success? Have you tried printing the
checkavailablestring string and running that command exactly? There may be
something wrong with the command or URL in some way, and calling os.system
instead of using the shell directly will hide any errors from you.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-list/attachments/20130609/3b0c2eb0/attachment.html>


More information about the Python-list mailing list