首页 > 移动平台 > 详细

python for android : ping

时间:2014-03-16 20:38:39      阅读:581      评论:0      收藏:0      [点我收藏+]

linux net : ping -c 4 host

ping.py

# -*- coding: utf-8 -*-
import android
import subprocess    
droid = android.Android()

host = droid.dialogGetInput(u"ping",u"请输入主机名 or IP:").result
if host is None:
    print ‘ host is None ‘
    sys.exit(4)

p = subprocess.Popen(["ping","-c","4",host], 
        stdin= subprocess.PIPE, 
        stdout= subprocess.PIPE, 
        stderr= subprocess.PIPE)    

out = p.stdout.read()
print out                                     



python for android : ping,布布扣,bubuko.com

python for android : ping

原文:http://blog.csdn.net/belldeep/article/details/21333183

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!