os.system question

Ruslan Spivak alienoid at is.lg.ua
Tue Jun 3 06:18:01 EDT 2003


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






More information about the Python-list mailing list