Advertisement
Guest User

Untitled

a guest
Nov 17th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. from tkinter import *
  2. import math
  3.  
  4. root = Tk()
  5.  
  6. root.title('Солнечная система')
  7. root.geometry('1020x650')
  8.  
  9. bg = Canvas(root, width = 1020, height= 650, bg = 'lightgrey')
  10. bg.pack()
  11.  
  12. def clicked():
  13. aEarth = test.get() #get password from entry
  14. print(aEarth)
  15.  
  16. test = StringVar()
  17. test_entry = Entry(textvariable=test, bg = 'gray', bd = 5 )
  18. test_entry.place(relx=0.22, rely=0.0264)
  19.  
  20. testtext_label = Label(text="Введите большую полуось земли:", bg = 'lightgrey', bd = 5)
  21. testtext_label.place(relx=0.019, rely=0.025)
  22.  
  23.  
  24. acceptButton = Button(root, text="Принять", command=clicked)
  25. acceptButton.place(relx=0.367, rely=0.0266, width = 120)
  26.  
  27.  
  28. bg.create_rectangle(10,10,500,100, fill ='white')
  29. bg.create_rectangle(10,120,1010,620, fill ='white')
  30.  
  31. for y in range(66):
  32. k = 25 * y
  33. bg.create_line(35+k, 120, 35+k, 620, width=0.5,fill ='lightgrey')
  34.  
  35. for x in range(21):
  36. k = 25 * x
  37. bg.create_line(10, 120+k, 1010, 120+k, width=0.5,fill ='lightgrey')
  38.  
  39. bg.create_line(10,120,1010,120, fill ='black')
  40. bg.create_line(10,620,1010,620, fill ='black')
  41. bg.create_line(10,120,10,620, fill ='black')
  42. bg.create_line(1010,120,1010,620, fill ='black')
  43.  
  44. root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement