os.system question

POYEN OP Olivier (DCL) Olivier.POYEN at clf-dexia.com
Tue Jun 3 08:21:56 EDT 2003


The return from os.system is the ending code from the process.

Better try os.popen and friends from os module. 

> -----Message d'origine-----
> De : Ruslan Spivak [mailto:alienoid at is.lg.ua]
> Envoyé : mardi 3 juin 2003 12:18
> À : python-list at python.org
> Objet : os.system question
> 
> 
> Hello, python users!
> 
> 
> I need to get result from 'ping' command(in manpage they are 
> 0, 1, 2), 
> but when i execute the following lines i i get strange results:
> 
> import os
> 
> res = os.system("ping -w 3 192.168.1.1")
> print res
> 
> This gives 256 or another numbers, what am i doing wrong?
> 
> Your help is very, very appreciated.
> 
> Best regards,
> Ruslan
> 
> 
> -- 
> http://mail.python.org/mailman/listinfo/python-list
> 
-------------- next part --------------
-----------------------------------------------------------------

Ce message est confidentiel ; son contenu ne represente en aucun

cas un engagement de la part de Dexia Credit Local ou de Dexia

CLF Banque. Toute publication, utilisation ou diffusion, meme

partielle, doit etre autorisee prealablement par l'emetteur. Si

vous n'etes pas destinataire de ce message, merci d'en avertir

immediatement l'expediteur.



This message is confidential ; its contents do not constitute a

commitment by Dexia Credit Local or Dexia CLF Banque. Any

unauthorised disclosure, use or dissemination, either whole or

partial, is prohibited. If you are not the intended recipient of

the message, please notify the sender immediately.

-----------------------------------------------------------------

Consultez notre site internet www.dexia-clf.fr

La cle d'une gestion optimisee du secteur public local

-----------------------------------------------------------------


More information about the Python-list mailing list