예제 #1
0
 def stop_climbing():
     root6 = Tk()
     root6.geometry('600x130+400+300')
     story = Label(root6,
                   text='''Возможно у Вас недостаточно денег,
 для будущих покупок! Пройдите к кассе!''',
                   font=('Arial', 20),
                   fg='blue')
     story.place(x=5, y=20)
     root6.after(2000, lambda: root6.destroy())
     root6.mainloop()
예제 #2
0
def speak():
    root8 = Tk()
    root8.geometry('420x100+550+200')
    lbl = Label(root8,
                text='''Если Вам интересны наши цены
    подойдите к табличке!''',
                font=("Cambria", 20),
                fg="DarkSlateBlue")
    lbl.place(x=1, y=15)
    root8.after(2000, lambda: root8.destroy())
    root8.mainloop()
예제 #3
0
 def how_much():
     window = Tk()
     window.geometry('300x250+530+180')
     lbl0 = Label(window,
                  text='У Вас примерно:',
                  font=("Cambria", 22),
                  fg="blue")
     lbl0.place(x=60, y=10)
     lbl = Label(window, text=[money], font=("Cambria", 40), fg="blue")
     lbl.place(x=100, y=60)
     lbl1 = Label(window, text='Грв.', font=("Cambria", 20), fg="blue")
     lbl1.place(x=100, y=150)
     window.after(2000, lambda: window.destroy())
     window.mainloop()
예제 #4
0
def no_product():
    root4 = Tk()
    root4.geometry('700x100+300+250')
    root4.title('Нет продукта')
    root4['bg'] = 'PapayaWhip'
    text2 = Label(root4,
                  text='Извините, такого продукта в нашем магазине нет!',
                  bg='PapayaWhip',
                  fg='Red',
                  font=('Comfortaa', 16))
    text2.place(x=30, y=20)

    root4.after(1000, lambda: root4.destroy())
    root4.mainloop()
예제 #5
0
def yes():
    global money
    money = float(entry_1.get())
    win = Tk()
    win.geometry('300x250+530+180')
    lbl0 = Label(win, text='У Вас с собой:', font=("Cambria", 20), fg="blue")
    lbl0.place(x=60, y=10)
    lbl = Label(win, text=[money], font=("Cambria", 40), fg="blue")
    lbl.place(x=100, y=60)
    lbl1 = Label(win, text='Грв.', font=("Cambria", 30), fg="blue")
    lbl1.place(x=100, y=150)
    root1.destroy()
    win.after(1000, lambda: win.destroy())
    win.mainloop()
    print(money)
예제 #6
0
def store_products():
    root7 = Tk()
    root7.geometry('830x300+300+230')
    story = Label(root7,
                  text='''В магазине сегодня распродажа!                    

    масло   -  54 грн           мясо    - 110 грн          капуста - 13 грн
    сахар   -  24.80 грн        рыба    - 80 грн           лук     - 12 грн
    молоко  -  26 грн           колбаса - 60 грн           хлеб    - 15 грн

    яйца    -  32.50 грн        рис     - 24.60 грн
    майонез -  28.90 грн        гречка  - 38.40 грн
                                                                                                    ''',
                  font=('Arial', 20),
                  fg='blue')
    story.pack()
    root7.after(4000, lambda: root7.destroy())
    root7.mainloop()
예제 #7
0
class CanvasDemo:
    def __init__(self):
        self.root = Tk()
        self.root.title("海王秘籍")
        self.canvas = Canvas(self.root, width=440, height=200, bg="White")
        self.canvas.pack()
        self.time_start = time.time()  #起始时间
        self.label = Label(text="")  #时间文本对象
        self.a = 0
        self.tetle = '''----------------------------------
wow钓鱼脚本v5.0(通用版)
说明:9键钓鱼,8开蚌壳,0键上鱼饵(请设置好宏),每钓鱼10分钟,自动上鱼饵
-----------------------------------
'''
        self.text_start = "3秒钟后开始钓鱼"
        self.text_start = self.tetle + self.text_start

        self.frame = Frame(self.root)
        self.frame.pack()
        self.btString = Button(self.frame, text="开 始", command=self.start)
        self.btClear = Button(self.frame, text="结 束", command=self.over)
        self.btString.grid(row=1, column=1)
        self.btClear.grid(row=1, column=2)
        self.label.pack()

        # self.p = Process(target=dy_run.dyrun)   #打开进程
        # self.str1 = ('python dy_run.py')    #测试环境
        self.str1 = ('dy_run.exe')  #exe环境

    def start(self):
        self.time_start = time.time()  #起始时间
        self.canvas.delete("rect", "oval", "arc", "polygon", "line", "string")

        self.canvas.create_text(220,
                                50,
                                text=self.text_start,
                                font="Tine 10 bold",
                                tags="string")
        self.a = 1
        self.p = subprocess.Popen(self.str1, shell=True)  #进程启动

        return self.a, self.p

    #结束按钮
    def over(self):
        self.canvas.delete("rect", "oval", "arc", "polygon", "line", "string")
        self.label.configure(text="运行了00时00分00秒")  #初始界面显示的文本
        self.tetle_over = self.tetle + self.over_time()
        self.canvas.create_text(220,
                                50,
                                text=self.tetle_over,
                                font="Tine 10 bold",
                                tags="string")
        self.a = 0
        self.time_start = time.time()
        # self.p.kill()  # 终止子进程            //windows下不好使
        os.system('taskkill /t /f /pid {}'.format(self.p.pid))  ##shell命令 结束进程

        return self.a, self.time_start

    #计算用时
    def over_time(self):
        time_new = time.time()
        timestamp = time_new - self.time_start
        m, s = divmod(timestamp, 60)
        h, m = divmod(m, 60)
        over_time = "程序一共运行了%02d时%02d分%02d秒" % (h, m, s)
        return over_time

    def update_clock(self):
        time_new = time.time()
        timestamp = time_new - self.time_start
        m, s = divmod(timestamp, 60)
        h, m = divmod(m, 60)
        shijian = "运行了%02d时%02d分%02d秒" % (h, m, s)

        if self.a == 1:
            self.label.configure(text=shijian)
        self.root.after(50, self.update_clock)

    def run(self):
        self.update_clock()
        self.canvas.create_text(220,
                                50,
                                text=self.tetle,
                                font="Tine 10 bold",
                                tags="string")
        self.root.mainloop()
예제 #8
0
                     font=("Cambria", 20))
        lbl2 = Label(root9,
                     text="--------------------------------",
                     font=("Cambria", 20))
        lbl3 = Label(root9, text=f"{cart}", font=("Cambria", 20))
        lbl4 = Label(root9,
                     text="--------------------------------",
                     font=("Cambria", 20))
        lbl5 = Label(root9, text=f"Сдача: {money} грн.", font=("Cambria", 20))
        lbl.place(x=10, y=15)
        lbl1.place(x=10, y=55)
        lbl2.place(x=10, y=95)
        lbl3.place(x=10, y=130)
        lbl4.place(x=10, y=260)
        lbl5.place(x=10, y=300)
        root9.after(2000, lambda: root9.destroy())
        root9.mainloop()
        playerY += 45

        # # my_products_and_money()
        # for prod, price in buyin.items():
        #     print(f"{prod}  --- {price} грн.")
        # print('Приходите к нам ещё! :)')

    fpsClock.tick(FPS)
    screen.fill((33, 46, 123))
    screen.blit(floorImg, (0, 0))
    screen.blit(ball1Img, (x1, y1))
    Sman(SmanX, SmanY)
    cashbox(cashbX, cashbY)
    man(manX, manY)