1
+ import tkinter .constants
2
+ from tkinter import *
3
+ def NUser ():
4
+ New_User = Tk ()
5
+ New_User .title ("New User" )
6
+ some = Button (New_User , text = 'Go Back' , command = New_User .destroy , width = 50 , height = 2 )
7
+ some .pack ()
8
+ New_User .mainloop ()
9
+ def ULogin ():
10
+ New_User = Tk ()
11
+ New_User .title ("Login" )
12
+ some = Button (New_User , text = 'Go Back' , command = New_User .destroy , width = 50 , height = 2 )
13
+ some .pack ()
14
+ New_User .mainloop ()
15
+ def SULogin ():
16
+ New_User = Tk ()
17
+ New_User .title ("Super User Login" )
18
+ some = Button (New_User , text = 'Go Back' , command = New_User .destroy , width = 50 , height = 2 )
19
+ some .pack ()
20
+ New_User .mainloop ()
21
+ def DUser ():
22
+ New_User = Tk ()
23
+ New_User .title ("Delete User" )
24
+ some = Button (New_User , text = 'Go Back' , command = New_User .destroy , width = 50 , height = 2 )
25
+ some .pack ()
26
+ New_User .mainloop ()
27
+ def NSUser ():
28
+ New_User = Tk ()
29
+ New_User .title ("New Super User" )
30
+ some = Button (New_User , text = 'Go Back' , command = New_User .destroy , width = 50 , height = 2 )
31
+ some .pack ()
32
+ New_User .mainloop ()
33
+ def FFinder ():
34
+ New_User = Tk ()
35
+ New_User .title ("Find My Friend" )
36
+ some = Button (New_User , text = 'Go Back' , command = New_User .destroy , width = 50 , height = 2 )
37
+ some .pack ()
38
+ New_User .mainloop ()
39
+
40
+ def main ():
41
+ chatbox_home = Tk ()
42
+ chatbox_home .title ("Chat Box" )
43
+ w = Frame (chatbox_home )
44
+ hello = Label (chatbox_home , text = 'Hi there Welcome to Online Chatting Room' , width = 50 , height = 2 )
45
+ hello .pack ()
46
+ some = Label (chatbox_home , text = 'Only benefit of this is no one knows you are here :):)' , width = 50 , height = 2 )
47
+ some .pack ()
48
+ choose = Label (chatbox_home , text = 'Choose Wisely:---------------' , width = 50 , height = 2 )
49
+ choose .pack ()
50
+ NUserButton = Button (chatbox_home , text = 'New User' ,fg = 'red' , command = NUser , width = 50 , height = 2 )
51
+ NUserButton .pack (side = TOP )
52
+ Login = Button (chatbox_home , text = 'Login' , fg = 'red' , command = ULogin , width = 50 , height = 2 )
53
+ Login .pack (side = TOP )
54
+ User = Button (chatbox_home , text = 'Login Super User' , fg = 'red' , command = SULogin , width = 50 , height = 2 )
55
+ User .pack (side = TOP )
56
+ DelAcc = Button (chatbox_home , text = 'Delete account' , fg = 'red' , command = DUser , width = 50 , height = 2 )
57
+ DelAcc .pack (side = TOP )
58
+ SUser = Button (chatbox_home , text = 'New Super User' , fg = 'red' , command = NSUser , width = 50 , height = 2 )
59
+ SUser .pack (side = TOP )
60
+ findfriend = Button (chatbox_home , text = 'Find Friend By Id' , fg = 'red' , command = FFinder , width = 50 , height = 2 )
61
+ findfriend .pack (side = TOP )
62
+ w .pack ()
63
+ chatbox_home .mainloop ()
64
+ # main()
65
+ while True :
66
+ try :
67
+ main ()
68
+ except :
69
+ main ()
70
+ finally :
71
+ main ()
0 commit comments