March 12, 2019

Тест

from tkinter import *
from time import sleep

def reset(testroot, one, two2):
	testroot.destroy()
	timer(one, two2)

def reset2(testroot):
	testroot.destroy()
	


def timer(one, two2):
	n = 0
	while True:
		if n < int(one):
			n+=1
			print(n)
			sleep(1)
		else:
			root = Tk()
			root.resizable(width=False, height=False)
			root.title("ДЗЫНЬ ДЗЫНЬ")
			root.geometry("350x135")
			# name_label = Label(text=str(two2))
			# name_label.place(relx=.1, rely=.08, anchor="w")
			text = Text(width=42, height=6, bg="white", fg='black', wrap=WORD)
			text.pack()
			text.insert(END, str(two2))
			message_button2 = Button(text="Exit", command=lambda:reset2(root))
			message_button2.place(relx=.50, rely=.87, width=120, anchor="c")
			root.mainloop()
			break
	


def main():
	root = Tk()
	root.resizable(width=False, height=False)
	root.title("Timer")
	root.geometry("350x120")

	token = StringVar()
	ids = StringVar()

	name_label = Label(text="Time:")
	surname_label = Label(text="Text:")


	name_label.place(relx=.1, rely=.20, anchor="w")
	surname_label.place(relx=.1, rely=.40, anchor="w")

	message_entry1 = Entry(textvariable=token, selectbackground="red")
	message_entry1.place(relx=.5, rely=.30, anchor="sw")

	message_entry2 = Entry(textvariable=ids, selectbackground="red")
	message_entry2.place(relx=.5, rely=.45, anchor="sw")


	message_button2 = Button(text="start", command=lambda:reset(root, token.get(), ids.get()))
	message_button2.place(relx=.50, rely=.8, width=120, anchor="c")


	root.mainloop()

if __name__ == "__main__":
	main()

from tkinter import *

from time import sleep

def reset(testroot, one, two2):

testroot.destroy()

timer(one, two2)

def reset2(testroot):

testroot.destroy()

def timer(one, two2):

n = 0

while True:

if n < int(one):

n+=1

print(n)

sleep(1)

else:

root = Tk()

root.resizable(width=False, height=False)

root.title("ДЗЫНЬ ДЗЫНЬ")

root.geometry("350x135")

# name_label = Label(text=str(two2))

# name_label.place(relx=.1, rely=.08, anchor="w")

text = Text(width=42, height=6, bg="white", fg='black', wrap=WORD)

text.pack()

text.insert(END, str(two2))

message_button2 = Button(text="Exit", command=lambda:reset2(root))

message_button2.place(relx=.50, rely=.87, width=120, anchor="c")

root.mainloop()

break

def main():

root = Tk()

root.resizable(width=False, height=False)

root.title("Timer")

root.geometry("350x120")

token = StringVar()

ids = StringVar()

name_label = Label(text="Time:")

surname_label = Label(text="Text:")

name_label.place(relx=.1, rely=.20, anchor="w")

surname_label.place(relx=.1, rely=.40, anchor="w")

message_entry1 = Entry(textvariable=token, selectbackground="red")

message_entry1.place(relx=.5, rely=.30, anchor="sw")

message_entry2 = Entry(textvariable=ids, selectbackground="red")

message_entry2.place(relx=.5, rely=.45, anchor="sw")

message_button2 = Button(text="start", command=lambda:reset(root, token.get(), ids.get()))

message_button2.place(relx=.50, rely=.8, width=120, anchor="c")

root.mainloop()

if __name__ == "__main__":

main()