-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathplay.py
More file actions
41 lines (32 loc) · 1.12 KB
/
play.py
File metadata and controls
41 lines (32 loc) · 1.12 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
import tkinter as tk
from tkinter import *
from maingame import *
def play_game():
#create a window
root=tk.Toplevel()
root.title("MASTERMIND.")
root.geometry("700x700")
root.iconbitmap(r'brain.ico')
# Add image file
bg = PhotoImage(file = "pegs1.png")
# Show image using label
label1 = Label(root, image = bg)
label1.place(x = 0, y = 0)
#entry widget and label
l1=Label(root,text='PLAYER NAME: ',font=('Showcard Gothic',25),background='navajowhite2',relief='solid',foreground='saddle brown').place(x=25,y=250)
e1=Entry(root,font=('Showcard Gothic',30),relief='solid',foreground='saddle brown',width=15).place(x=300,y=250)
print(type(e1))
def name():
print(type(e1))
e1.get()
f=open('name.txt',mode='w')
f.write(e1.get())
f.close()
return main()
#start game button
root.loadimage2=PhotoImage(file="greenball2.png")
root.greenbutton1=Button(root,image=root.loadimage2,command=name)
root.greenbutton1["bg"]='black'
root.greenbutton1.place(x=300,y=400)
root.mainloop()
play_game()