def application(): """Returns the global Application object. Creates a default one if needed.""" global _application if not _application: from GUI import Application _application = Application() return _application
#!/usr/bin/env python from GUI import Application if __name__ == '__main__': app = Application() app.master.resizable(width=False, height=False) app.master.title("Sudoku Solver") app.mainloop()
def printComments(comments): for user, comment in comments: print(user + " says...") print(comment) printLine() gameID = input("Enter your game id: ") comments = getExtracted(gameID) printComments(comments) noOfComments = len(comments) print("\n\n\n" + str(noOfComments) + " comments in total.") time = int(input("How often should I check for more (seconds)? ")) Application() while (True): print(".", end="", flush=True) sleep(time) comments = getExtracted(gameID) if (len(comments) > noOfComments): numberOfNew = noOfComments - len(comments) new = comments[numberOfNew:] alert('note', 'New Comment!') print("\n****** NEW COMMENTS ******") printLine() printComments(new) noOfComments = len(comments)
def main(): root = tkinter.Tk() app = Application(master=root) app.mainloop()
def main(): window = tk.Tk() app = Application(window) window.mainloop()
def __init__(self,parent): self.parent = parent self.model = PlayRecommender() self.view = Application(master=parent, vc=self) self.capture = CardCapture()
from CreateObjects import CreateObjects import tkinter as tk from GUI import Application # create random data for stuff createObjects = CreateObjects() # initial tkinter root = tk.Tk() # begin gui app = Application(createObjects.createRoom(1, 1, 1, 2, 1, 'Living Room'), master=root) app.mainloop()
f2 = StringVar() Sha256f1 = StringVar() Sha256f2 = StringVar() MD5f1 = StringVar() MD5f2 = StringVar() Sha1f1 = StringVar() Sha1f2 = StringVar() checksum = Frame(root, width=1350, height=1000, relief='raise', bd=14) checksum.pack(side=LEFT, expand=True, fill=None) password_gen = Frame(root, width=100, height=100, relief='raise', bd=14) password_gen.pack(side=RIGHT, expand=True, fill='y') stego = Frame(root, width=1350, height=1000, relief='raise', bd=14) stego.pack(side=RIGHT, expand=True, fill='y') app = Application(stego) ckslbl = Label(checksum, text='CHECKSUM VERIFER').pack(side=TOP) stegolbl = Label(stego, text='STEGANOGRAPHY MINI-TOOLKIT').pack(side=TOP) password_genlbl = Label(password_gen, text="SECURE PASSWORD GENERATOR").pack(side=TOP) def hash_bytestr_iter(bytesiter, hasher, ashexstr=True): for block in bytesiter: hasher.update(block) return (hasher.hexdigest() if ashexstr else hasher.digest()) def file_as_blockiter(afile, blocksize=65536): with afile:
from GUI import Application # Define the shared data between the processes msgQ = Queue(0) data_array = Array(ctypes.c_ubyte, 50) if __name__ == '__main__': # Create the root window root = Tk() root.title('KSP Controller') root.configure(background="black") root.geometry('{0}x{1}'.format(c_screen_size_x, c_screen_size_y) + c_screen_pos) # Instatiate the GUI app = Application(root, data_array, msgQ) stage_prev = None frame_time = time() # Loop the window, calling an update then refreshing the window while 1: if time() > frame_time + 0.250: frame_time = time() if app.game_connected == False or app.vessel_connected == False: app.connect(msgQ) elif app.conn.krpc.current_game_scene == app.conn.krpc.current_game_scene.flight: if app.vessel.control.current_stage is not stage_prev: app.update_streams() stage_prev = app.vessel.control.current_stage