سورس تایمر شمارش معکوس ساده با پایتون ، در این بخش از سورس سافت با یکی دیگر از سورس کدهای کاربردی پایتون در خدمت شما دوستان همیشگی سایت هستیم.
سورس تایمر شمارش معکوس ساده با پایتون
سورس کد تایمر شمارش معکوس ساده با زبان برنامه نویسی پایتون به صورت کاربردی کدنویسی شده است. با بررسی کدهای نوشته میتوانید سطح برنامه نویسی پایتون خود را ارتقا داده و برنامه های کاربردی خلاقی بنویسید.
def countdown(count):
lbl_text['text'] = count
if count > 0:
root.after(1000, countdown, count-1)
elif(count == 0):
global NewForm
NewForm = Toplevel()
NewForm.title("sourcesoft")
width = 500
height = 300
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
x = (screen_width/2) - (width/2)
y = (screen_height/2) - (height/2)
NewForm.geometry("%dx%d+%d+%d" % (width, height, x, y))
NewForm.resizable(0, 0)
lbl_blast = Label(NewForm, text="Blast Off!", font=('arial', 50))
lbl_blast.pack(fill=BOTH, pady=100)
btn_back = Button(NewForm, text="Reset", font=('arial', 16), command=BackBtn)
btn_back.pack(side=TOP)
def StartCountdown():
countdown(10)
btn_toggle.config(state=DISABLED)
def BackBtn():
NewForm.destroy()
btn_toggle.config(state=NORMAL)
lbl_text.config(text="10")
امیدواریم این سورس کد پایتون مورد استفاده شما دوستان قرار بگیرد.