Luego de meses o quizás año sin tocar la librería QT4 de Python, hoy me quise re-encantar con dicha lib. Ya se me olvidó todo, a tal punto que tuve que re-leer el mismo tutorial que hice hace un tiempo, pero viendo algunos códigos viejos que hice, ya recordé algo

(...) Sin embargo no traigo un graaaaaan código, solo es un Escaner de puertos, con algo de CSS :

Código
# -*- coding: utf-8 -*- # self.setGeometry(X, Y, Width, Height) from PyQt4 import QtGui, QtCore import sys import httplib class programa(QtGui.QWidget): def __init__(self, parent=None): QtGui.QWidget.__init__(self, parent) self.setFixedSize(230, 110) self.setWindowTitle("Escaner de Puertos") self.setStyleSheet("background: #000;") # URL , LABEL URL self.url = QtGui.QLineEdit(self) self.url.setGeometry(27, 10, 200, 20) self.url.setStyleSheet("color: #fff; background: #000;") self.url_label = QtGui.QLabel("URL:", self) self.url_label.setStyleSheet("color: #fff;") self.url_label.setGeometry(3, 10, 25, 20) # PUERTO, LABEL PUERTO self.puerto = QtGui.QLineEdit(self) self.puerto.setGeometry(41, 35, 40, 20) self.puerto.setStyleSheet("color: #fff; font-weight: bold; background: #000;") self.puerto_label = QtGui.QLabel("Puerto:", self) self.puerto_label.setStyleSheet("color: #fff;") self.puerto_label.setGeometry(3, 36, 35, 20) # STATUS, LABEL STATUS self.status_label = QtGui.QLabel("Estado:", self) self.status_label.setStyleSheet("color: #fff;") self.status_label.setGeometry(3, 60, 50, 20) self.esperando = QtGui.QLabel("Esperando", self) self.esperando.setStyleSheet("color: red; font-weight: bold; background: #000;"); self.esperando.setGeometry(44, 60, 100, 20) # BOTON self.boton = QtGui.QPushButton("Scan!", self) self.boton.setStyleSheet("color: #fff; background: #000; border: 2px solid #fff;") self.boton.setGeometry(3, 85, 225, 20) self.connect(self.boton, QtCore.SIGNAL("clicked()"), self.scan) def scan(self): url = str(self.url.text()) puerto = int(self.puerto.text()) try: conn = httplib.HTTPConnection(url, puerto, timeout=2) BODY = "***filecontents***" conn.request("GET", "/", BODY) resp = conn.getresponse() if resp.status == 200: self.esperando.setStyleSheet("color: green; font-weight: bold") self.esperando.setText("%s Abierto" % puerto) conn.close() except: self.esperando.setStyleSheet("color: red; font-weight: bold") self.esperando.setText("%s Cerrado" % puerto) app = QtGui.QApplication(sys.argv) form = programa() form.show() app.exec_()
Saludos !