#!/usr/bin/env python3 from tkinter import * from socket import * from struct import * from sys import argv, exit class LurkReader(Frame): def __init__(self, master): Frame.__init__(self, master) self.pack(fill="both", expand=1) self.connect_box = Frame(self) self.connect_box.pack(fill="y", expand=1) self.hostname_textbox = Text(self.connect_box, height=1, width=50) self.hostname_textbox.grid(row=0, column=0) self.port_textbox = Text(self.connect_box, height=1, width=7) self.port_textbox.grid(row=0, column=1) connect_button = Button(self.connect_box, text="Connect to Server", command=self.connect_to_server) connect_button.grid(row=0, column=2) self.server_info = Text(self) self.server_info.pack() def connect_to_server(self): # Get the hostname and the port from the GUI hostname = self.hostname_textbox.get(1.0, "end").strip() port = int(self.port_textbox.get(1.0, "end").strip()) print((hostname, port)) skt = socket(AF_INET, SOCK_STREAM) skt.connect((hostname, port)) # It'd be a good idea to see if this worked! mtype = unpack_from("