摘要: import os, re# execute command, and return the outputdef execCmd(cmd): r = os.popen(cmd) text = r.read() r.close() return text# write "dat... 阅读全文
posted @ 2015-03-31 14:29 ZaneYall 阅读(3450) 评论(0) 推荐(0) 编辑
摘要: Windows下2种方法:1.使用拨号上网的话,一般都有一个本地ip和一个外网ip,使用python可以很容易的得到这两个ip使用gethostbyname和gethostbyname_ex两个函数可以实现import socketlocalIP = socket.gethostbyname(s... 阅读全文
posted @ 2014-09-11 09:57 ZaneYall 阅读(817) 评论(0) 推荐(0) 编辑