Página 1 de 1

[Python] HTTP Console By Doddy H

Publicado: 20 Ago 2015, 04:15
por Doddy
Bueno , este es un simple programa en python hecho en tk que permite mandar peticiones webs a un servidor en concreto.
#!usr/bin/python
#Console (C) Doddy Hackman 2011

from Tkinter import *
import socket

global x,socket

def execa() :

 s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
 s.connect((str(host.get()),80))
 s.send(cmd.get()+"\r\n")
 data = s.recv(666)
 s.close()
 panel.insert(END,repr(data))

window = Tk()
window.title("HTTP Console (C) Doddy Hackman 2011")

window.maxsize(width="400",height="350")
window.minsize(width="400",height="350")

window.configure(background="black")
window.configure(cursor="tcross")

host = StringVar()
cmd = StringVar()

panel = Text(window,width=30,height=15,bg="black",fg="red")

Label(window,bg="black").grid(row=3)

Label(window,text="Host : ",bg="black",fg="red").grid(row=4,column=4)
entry = Entry(window,width=35,textvariable=host,bg="black",fg="red").grid(row=4,column=5)

Label(window,text="Command : ",bg="black",fg="red").grid(row=8,column=4)
entry = Entry(window,width=35,textvariable=cmd,bg="black",fg="red").grid(row=8,column=5)

Button(text="Cargar",bg="black",fg="red",activebackground="red",command=execa).grid(row=8,column=9)

Label(window,bg="black").grid(row=19)
panel.grid(row=20,column=5)	

window.mainloop()