Posts

Showing posts with the label tkinter

How to destroy the First Window?

How to destroy the First Window? I am making the GUI Chat Program using the following Steps as following: After the Login is successful, the First Window has not been destroyed. (OS : window 7, Python 2.7) Please, help me to destroy the First Window successfully!! chat_login.py: from socket import * import thread, time import msvcrt as m from tkinter import * from tkinter import scrolledtext import os import sys login_w = Tk() login_w.title("The SCH Chat-Client V0.1") login_w.geometry('400x100') s = socket(AF_INET, SOCK_STREAM) id_label = Label(login_w,text=" I D : " ) id_label.grid(column=0, row=0) id_txt = Entry(login_w) id_txt.grid(row=0, column=1) pass_label = Label(login_w,text="Password : " ) pass_label.grid(column=0, row=1) pass_txt = Entry(login_w) pass_txt.grid(row=1, column=1) def recvMsg(sock): while True: recvmsg = sock.recv(1024) def Con_Clicked(): host = "127.0.0.1" port = 8008 print host try:...

How do I compile my Python 3 app to an .exe? [closed]

How do I compile my Python 3 app to an .exe? [closed] How do I convert my Python app to a .exe ? I made a program with tkinter and was wondering how to make it possible for others to use. I use Python 3.3. I searched for a bit but could not find anything. .exe tkinter This question appears to be off-topic. The users who voted to close gave this specific reason: yes, but they are all for 2.7 and below, i use 3.3 – Samir Chahine Jul 28 '13 at 10:32 Okay, but it is still a very common question. My answer was from a quick Google search. – Andy G Jul 28 '13 at 10:38 I added the 3 to your title but, unfortunately, I suspect your question still might get closed. Goo...

Button switching using python (Tkinter)

Button switching using python (Tkinter) What I'm trying to do is to switch buttons, basically. When button 1 is pressed it gets destroyed and then button 2 launches. I'm having an error, here's the code. from Tkinter import * root = Tk() root.title('TEST') def D1(): B.destroy() Launch2() def D2(): B2.destroy() Launch1() def Launch1(): B = Button (root, text = 'BUTTON 1', command = D1) B.pack() def Launch2(): B2 = Button (root, text = 'BUTTON 2', command = D2) B2.pack() Launch1() mainloop() Error : Exception in Tkinter callback Traceback (most recent call last): File "C:Python27liblib-tkTkinter.py", line 1541, in __call__ return self.func(*args) File "C:UsersyouseDesktopTkinter Testing GUI.py", line 5, in D1 B.destroy() NameError: global name 'B' is not defined The error is telling the truth. There's nowhere in your code where you're cre...