Facebook
From Kaya, 4 Years ago, written in Python.
Embed
Download Paste or View Raw
Hits: 245
  1. from tkinter import *
  2.  
  3. root = Tk()
  4. root.geometry('300x300')
  5. root.title('Discord bot GUI')
  6. root.iconbitmap(r'gear.ico')
  7.  
  8. # ****  FUNCTIONS  ****
  9.  
  10. def save_input():
  11.     firstName_info = firstName.get()
  12.     lastName_info = lastName.get()
  13.     print (firstName_info, lastName_info)
  14.    
  15.  
  16. file = open ('user.txt', "a")
  17. file.write ("First name :", firstName_info)
  18. file.write ("Last name :", lastName_info)
  19.  
  20. file.close()
  21. print ('User', firstName_info, 'has been registered succesfully')
  22.  
  23.  
  24.  
  25.  
  26.  
  27. # **** APPEARANCE ****
  28.  
  29. def doNothing():
  30.     print("ok ok I won't...")
  31.  
  32. toolbar = Frame(root, bg="black")
  33.  
  34. insertButt = Button(toolbar, text="Kick...", command=doNothing)
  35. insertButt.pack(side=LEFT, padx=2, pady=2)
  36. printButt = Button(toolbar, text="Ban...", command=doNothing)
  37. printButt.pack(side=LEFT, padx=2, pady=2)
  38.  
  39. toolbar.pack(side=TOP, fill=X)
  40.  
  41. status = Label(root, text='ServiceCord™', bg='black', fg='white', bd=1, relief=SUNKEN, anchor=W)
  42. status.pack(side=BOTTOM, fill=X)
  43.  
  44. # entrys
  45.  
  46.  
  47. firstName_text = Label (text='First name *' )
  48. lastName_text = Label (text = 'Last name *')
  49. age_text = Label (text= 'Age *')
  50. firstName_text.place(x=15 , y=40)
  51. lastName_text.place(x=15, y=90)
  52.  
  53.  
  54. firstName =StringVar()
  55. lastName =StringVar()
  56.  
  57.  
  58.  
  59. firstName_entry = Entry (textvariable = firstName, width = '30')
  60. lastName_entry = Entry (textvariable= lastName, width ='30')
  61.  
  62.  
  63. firstName_entry.place (x=15, y=60)
  64. lastName_entry.place (x=15, y=110)
  65.  
  66.  
  67.  
  68. submit = Button (text='submit', width='7', height='2',  command= save_input, bg = 'grey')
  69. submit.place(x=15, y=150)
  70.  
  71.