Advertisement
Guest User

sos

a guest
Jun 17th, 2019
115
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 2.11 KB | None | 0 0
  1. from tkinter import *
  2. import tkinter as tk
  3. import time
  4. import random
  5. import sys
  6. import os
  7.  
  8. def menu():
  9.  
  10.     wTitle = "Death Date - KyrosDesign"
  11.    
  12.     windowMain = tk.Tk()
  13.     windowMain.geometry("400x600")
  14.     windowMain.title(wTitle)
  15.     windowMain.resizable(False, False)
  16.  
  17.     global dayBirth
  18.     global monthBirth
  19.     global yearBirth
  20.  
  21.     dayBirth = IntVar()
  22.     monthBirth = IntVar()
  23.     yearBirth = IntVar()
  24.  
  25.     global dayEntry
  26.     global monthEntry
  27.     global yearEntry
  28.  
  29.     Label(windowMain, text="Welcome in Death Date", font=("Sans-Serif",12), bg="#191919", fg="#ddd",width="50",height="2").pack()
  30.     dayLabel = Label(windowMain, text="Day: ", font=("Sans-Serif",12), fg="#191919").place(y=58,x=65)
  31.     dayEntry = Entry(windowMain, textvariable=dayBirth, fg="#191919",width="5",font=("Sans-Serif", 13)).place(y=58,x=120)
  32.     monthLabel = Label(windowMain, text="Month: ", font=("Sans-Serif",12), fg="#191919").place(y=98,x=65)
  33.     monthEntry = Entry(windowMain, textvariable=monthBirth, fg="#191919",width="5",font=("Sans-Serif", 13)).place(y=98,x=120)
  34.     yearLabel = Label(windowMain, text="Year: ", font=("Sans-Serif",12), fg="#191919").place(y=138,x=65)
  35.     yearEntry = Entry(windowMain, text="Day: ", textvariable=yearBirth, fg="#191919",width="5",font=("Sans-Serif", 13)).place(y=138,x=120)
  36.     Button(windowMain, text="Get Death Date", font=("Sans-Serif",9), bg="#191919", fg="#ddd",width="13",height="6", command = process).place(y=58,x=220)
  37.  
  38.     if __name__ == '__main__':
  39.         windowMain.mainloop()
  40.  
  41. def process():
  42.  
  43.     dayB = dayEntry.get()
  44.     monthB = monthEntry.get()
  45.     yearB = yearEntry.get()
  46.  
  47.     wTitle = "Death Date - KyrosDesign"
  48.    
  49.     windowGame = tk.Tk()
  50.     windowGame.geometry("400x600")
  51.     windowGame.title(wTitle)
  52.     windowGame.resizable(False, False)
  53.  
  54.     months = ['January','February','March','April','May','June','July','August','September','October','November ','December']
  55.  
  56.     days = random.randint(1,31)
  57.     months = random.choice(months)    
  58.     years = random.randint(2019, 2119)
  59.     age = years - yearB
  60.  
  61.     print(age)
  62.  
  63.    
  64. menu()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement