#!/usr/bin/python3 from tkinter import * from socket import * #from threading import Thread from _thread import start_new_thread from struct import unpack_from class FFUI(Frame): def __init__(self, master): Frame.__init__(self, master) self.pack(fill='both', expand=1) self.textwindow = Frame(self) self.controls = Frame(self) self.controls.pack(side=RIGHT) self.textwindow.pack(side=LEFT, fill='both', expand=1) self.editor = Text(self.textwindow) self.editor.pack(fill='both', expand=1) self.something_button = Button(self.controls, text="Connect", command=self.connect) self.something_button.pack() Button(self.controls, text="Change other button", command=self.change_text).pack() def connect(self): # TODO: Get this from the user self.skt = socket(AF_INET, SOCK_STREAM) self.skt.connect(("isoptera.lcsc.edu", 5014)) # TODO: Did it work? # self.read_thread_handle = Thread(target=self.read_thread_method, args=[]) # self.read_thread_handle.run() start_new_thread(self.read_thread_method, ()) print("Started thread") def change_text(self): self.something_button.configure(text = "moose") def read_thread_method(self): print("Thread is running"); while True: next_type = unpack_from("