def ping(): address = 'ya.ru' while True: result=subprocess.Popen(["ping",'-n','1', str(address)],shell=True,stdout=subprocess.PIPE) ping = (result.stdout.read().decode('cp866')) m = ping.split() if len(m) != 48: b = '0' else: b = m[46]
Есть простейший GUI:
import sys from PyQt4 import QtGui class Absolute(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.setWindowTitle('Communication') label = QtGui.QLabel('Hello', self) app = QtGui.QApplication(sys.argv) qb = Absolute() qb.show() sys.exit(app.exec_())