-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscreen.py
More file actions
76 lines (53 loc) · 2.07 KB
/
screen.py
File metadata and controls
76 lines (53 loc) · 2.07 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
from tkinter import *
from PIL import Image ,ImageTk
import os
from time import strftime
#Main screen
screen=Tk()
screen.title('Subham Mahapatra Games')
#screen.iconbitmap('Icons//logo.ico')
screen.geometry('590x650+100+50')
screen.minsize(750,500)
screen.maxsize(750,500)
#screen.maxsize(590,650)
img = Image.open('/Users/subhammahapatra/Desktop/Project/mainback.jpg')
img = ImageTk.PhotoImage(img.resize((745,490)))
img1 = Image.open('/Users/subhammahapatra/Desktop/Project/f.png')
img1 = ImageTk.PhotoImage(img1.resize((80,80)))
img2 = Image.open('/Users/subhammahapatra/Desktop/Project/k.png')
img2 = ImageTk.PhotoImage(img2.resize((80,80)))
img3 = Image.open('/Users/subhammahapatra/Desktop/Project/icotic.png')
img3 = ImageTk.PhotoImage(img3.resize((100,100)))
label1 = Label(screen,image = img)
label1.place(x=0,y=0)
#commands
def ninja_game():
os.system('python3 /Users/subhammahapatra/Desktop/Project/fruit_game/ninja.py')
def knife_fight():
os.system('python3 /Users/subhammahapatra/Desktop/Project/Knife-Hit-PyGame-master/knife.py')
def tic_tac():
os.system('python3 /Users/subhammahapatra/Desktop/Project/tic.py')
B1=Button(screen,image= img1 ,padx=10,pady=1,font=('Algerian',20) ,command=ninja_game)
B1.place(x=560,y=350)
B2=Button(screen,image= img2,padx=10,pady=1,font=('Algerian',20) ,command=knife_fight)
B2.place(x=100,y=350)
B3=Button(screen,image= img3,padx=10,pady=1,font=('Algerian',20) ,command=tic_tac)
B3.place(x=330,y=220)
def time():
string = strftime('%H:%M:%S %p')
lbl.config(text = string)
lbl.after(1000, time)
# Styling the label widget so that clock
# will look more attractive
lbl = Label(screen, font = ('calibri', 25, 'bold'),
background = 'red',
foreground = 'white')
# Placing clock at the centre
# of the tkinter window
lbl.pack(anchor = 'center')
lbl.place(x=285,y=150)
time()
#B3=Button(screen,text= 'ice ball',padx=53,pady=1,font=('Algerian',20) ,command=ice_ball)
#B3.place(x=400,y=350)
screen.configure()
screen.mainloop()