示例#1
0
def create_application_root():
    root = Tk()
    root.tk.eval('package require Tix')
    root.minsize(500, 300)
    app = Application(root)
    app.pack(fill=BOTH, expand=True)
    return root, app
def makesure(skin):
    def delt():
        cv2.destroyWindow("frame")
        cv2.destroyWindow("RESULT")
        root2.destroy()
    def suss():
        save()
        cv2.destroyWindow("frame")
        cv2.destroyWindow("RESULT")
        root2.destroy()
    root2 = Tk() # 初始化Tk()
    root2.title("INDEX")    # 设置窗口标题
    root2.geometry("400x400")    # 设置窗口大小 注意:是x 不是*
    root2.resizable(width=True, height=True) # 设置窗口是否可以变化长/宽,False不可变,True可变,默认为True
    root2.tk.eval('package require Tix')  #引入升级包,这样才能使用升级的组合控件

    lable = Label(root2, text="Do u want to save the result pic?", bg="blue",bd=10, font=("Arial",12), width=30, height=3)
    lable.pack(side=TOP)

    button=Button(root2,text='Confirm',command=suss,activeforeground="black",activebackground='blue',bg='green',fg='white')
    button.pack(side=BOTTOM)

    button=Button(root2,text='Delete',command=delt,activeforeground="black",activebackground='blue',bg='red',fg='white')
    button.pack(side=BOTTOM)

    cv2.namedWindow("RESULT", cv2.WINDOW_GUI_EXPANDED)
    cv2.imshow("RESULT",skin)

    root2.mainloop()
示例#3
0
    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环境
示例#4
0
    def prod():
        root2 = Tk()
        root2.geometry('400x170+450+250')
        root2.title('Продукты в АТБ')

        def prodi():
            global user_input
            user_input = (entry_1.get())
            root2.destroy()

        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()

        def end():
            pass

        label = Label(root2,
                      text="Какой продукт берём?",
                      fg='#000875',
                      font=("Cambria", 20))
        entry_1 = Entry(root2,
                        font=("Ubuntu", 20),
                        fg='#000875',
                        bg='LightCyan',
                        justify='center')
        text = Label(root2,
                     text='Название продукта:',
                     fg='#DA0700',
                     font='Cambria')
        btn = Button(root2,
                     text="Беру!",
                     command=prodi,
                     bg="lime",
                     font='Cambria')
        btn2 = Button(root2,
                      text="Сейчас у маня...",
                      command=how_much,
                      bg="LightGray",
                      font='Cambria')
        btn3 = Button(root2, text="Хорош", command=end, font='Cambria')
        label.place(x=50, y=10)
        text.place(x=110, y=50)
        entry_1.place(x=40, y=70)
        entry_1.focus_set()
        btn.place(x=40, y=120)
        btn2.place(x=190, y=120)
        btn3.place(x=320, y=120)
        root2.mainloop()
示例#5
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()
示例#6
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()
示例#7
0
def sms():
    # Вы оплатили товар
    root3 = Tk()
    root3.geometry("500x200+350+250")
    root3.title('Window name')
    root3['bg'] = '#FFA07A'

    def goodluck():
        sl.destroy()
        btn1.destroy()
        btn2.destroy()
        gd = Label(root3,
                   text="Хорошего Вам дня!",
                   font="Broadway 20",
                   fg="green",
                   bg="#C0C0C0")
        gd.place(x=120, y=70)

    def shet():
        sl.destroy()
        btn1.destroy()
        btn2.destroy()
        gd = Label(root3,
                   text="Вызываем полицию?",
                   font="Broadway 20",
                   fg="black",
                   bg="#C0C0C0")
        gd.place(x=100, y=70)

    sl = Label(text='У Вас оплачены продукты?',
               font='Comfortaa 20',
               fg='black',
               bg='#FFA07A')
    btn1 = Button(root3,
                  text='ДА',
                  bg='#228B22',
                  fg='#ccc',
                  width=13,
                  height=3,
                  command=goodluck)
    btn2 = Button(root3,
                  text='НЕТ',
                  bg='#FF0000',
                  fg='#ccc',
                  width=13,
                  height=3,
                  command=shet)
    sl.pack()
    btn1.place(x=120, y=80)
    btn2.place(x=270, y=80)

    root3.mainloop()
示例#8
0
文件: gui.py 项目: Sictiy/JServer
 def __init__(self):
     # init window
     self.root = Tk()
     self.root.title("dbTools")
     self.root.geometry('960x480')
     self.left = Treeview(self.root)
     self.right = Treeview(self.root)
     self.main_menu = Menu(self.root)
     self.init_left()
     self.init_right()
     self.init_main_menu()
     self.root.config(menu=self.main_menu)
     self.root.bind('Button-3', self.popup_menu)
示例#9
0
def mainctrl():
    mc = Tk()
    mc.title("主动控制")
    mc.geometry("250x250")
    bup = Button(mc, text="向上")
    bdown = Button(mc, text="向下")
    bleft = Button(mc, text="向左")
    bright = Button(mc, text="向右")
    bup.pack()
    bdown.pack()
    bleft.pack()
    bright.pack()
    mc.mainloop()
示例#10
0
def navigation():
    navi = Tk()
    navi.title("自主导航")
    navi.geometry("250x250")
    b1 = Button(navi, text="显示位置")
    b1.pack()
    b2 = Button(navi, text="设置目标点")
    b2.pack()
    b3 = Button(navi, text="建立地图")
    b3.pack()

    bright = Button(navi, text="开始导航", )
    bright.pack()
    navi.mainloop()
示例#11
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()
示例#12
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()
示例#13
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)
示例#14
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()
示例#15
0
def requerimientos_activos():
    ventana_requerimientos = Tk()

    ventana_requerimientos.title('Requerimientos activos')
    ventana_requerimientos.minsize(300, 200)

    cursor_temp = conexion.cursor()
    query_requerimientos = cursor_temp.execute(
        "Select * from REQUERIMIENTOS").fetchall()
    cursor_temp.close()

    lista_requerimientos = Listbox(ventana_requerimientos, selectmode=SINGLE)
    lista_requerimientos.pack()

    for row_requerimiento in query_requerimientos:
        nombre_req = '{0} - {1}'.format(row_requerimiento[0],
                                        row_requerimiento[1])
        lista_requerimientos.insert(END, nombre_req)

    Button(ventana_requerimientos,
           text='Seleccionar requerimiento',
           command=(lambda: requerimiento(query_requerimientos[
               lista_requerimientos.curselection()[0]]))).pack()
示例#16
0
def signin():
    sin = Tk()
    sin.title("登录界面")
    sin.geometry("250x250")

    v1 = StringVar()
    e1 = Entry(sin,textvariable=v1,width=10)
    e1.grid(row=100,column=200,padx=1,pady=1)

    lable1=Label(sin,text='用户名:  ')
    lable1.grid(row=100,column=125)

    v2 = StringVar()
    e2 = Entry(sin,textvariable=v2,width=10)
    e2.grid(row=110,column=200,padx=1,pady=1)

    lable2=Label(sin,text='密码:  ')
    lable2.grid(row=110,column=125)

    button1 = Button(sin, text="登录", command = sin.quit, activeforeground="black", bg="white",bd=5, font=("Arial",8), width=4, height=2)
    button1.grid(row=200,column=125)

    sin.mainloop
示例#17
0
FIRST='first'
LAST='last'
BUTT='butt'
PROJECTING='projecting'
ROUND='round'
BEVEL='bevel'
MITER='miter'

# Arguments to xview/yview

MOVETO='moveto'
SCROLL='scroll'
UNITS='units'
PAGES='pages'

root = Tk() 
root.title("hello tkinter")
root.geometry("1000x700")
root.resizable(width=True, height=True)
root.tk.eval('package require Tix')

lable2 = Label(root, text="状态", bg="gray",bd=10, font=("Arial",12), width=8, height=3)
lable2.pack(anchor = NE)

lable3 = Label(root, text="正常", bg="gray",bd=10, font=("Arial",12), width=8, height=3)
lable3.pack(anchor = NE)


lable1 = Label(root, text="当前用户", bg="gray",bd=10, font=("Arial",12), width=8, height=3)
lable1.pack(anchor = NW)
示例#18
0
import random
import time
import os
import tkinter.tix
import pickle
from tkinter import *
from tkinter.constants import *
from tkinter.tix import FileSelectBox, Tk

root = Tk()
root.title('Instructions for playing Sudoku')
root.geometry('800x800')
canvas = Canvas(root, width=1680, height=700, bg='skyblue')
canvas.pack()
photo = PhotoImage(
    file='C:\\Users\\Abhinav\\Downloads\\sudoku-instructions.png')
canvas.create_image(0, 0, image=photo, anchor=NW)
btn = Button(root,
             text='START',
             width=1680,
             height=15,
             fg="black",
             bg="pink",
             command=root.destroy)
btn.pack(side='bottom')
root.mainloop()


class SudokuBoard:
    def __init__(self):
        self.clear()
示例#19
0
        if master:
            master.title("SudokuGUI")

        self.board = board
        self.board_generator(board)
        bframe = Frame(self)

        self.ng = Button(bframe, command=self.new_game, text="New Game")
        self.ng.pack(side='left', fill='x', expand='1')

        self.sg = Button(bframe, command=self.save_game, text="Save Game")
        self.sg.pack(side='left', fill='x', expand='1')

        self.lg = Button(bframe, command=self.load_game, text="Load Game")
        self.lg.pack(side='left', fill='x', expand='1')

        self.query = Button(bframe, command=self.query_board, text="Set Board Algorithm")
        self.query.pack(side='left', fill='x', expand='1')

        bframe.pack(side='bottom', fill='x', expand='1')
        self.make_grid()
        self.canvas.bind("<Button-1>", self.canvas_click)
        self.canvas.bind("<Key>", self.canvas_key)
        self.current = None
        self.pack()

if __name__ == '__main__':
    board = SudokuBoard()
    tk = Tk()
    gui = SudokuGUI(tk, board)
    gui.mainloop()
示例#20
0
def main_page(root_function):
    global Algorithm_choice
    Algorithm_choice = 0

    root_function.destroy()

    root = Tk()
    root.title("A Compressed Software By Wang,Xu,Wu,Huang")
    root.geometry("999x666")
    root.resizable(width=True, height=True)
    root.eval('package require Tix')
    root['bg'] = '#FFFAF0'
    text1 = Label(root,
                  text="-⭐-Choose the compressed algorithm you want-⭐-",
                  bg="#FFFAF0",
                  fg="BLACK",
                  font=("黑体", 25),
                  width=50,
                  height=2,
                  anchor="center")
    text1.place(x=70, y=40)
    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#D8BFD8",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=70, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#DDA0DD",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=282, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#BA55D3",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=494, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#8B008B",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=706, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#D8BFD8",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=70, y=480)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#DDA0DD",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=282, y=480)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#BA55D3",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=494, y=480)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#8B008B",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=706, y=480)

    button1_1 = Button(root,
                       text="Huffman",
                       font=("宋体", 25),
                       command=lambda: algorithm(1, root),
                       width=15,
                       height=2,
                       bg="#FFE4C4")
    button1_1.place(x=70, y=300)

    button1_2 = Button(root,
                       text="Zip",
                       font=("宋体", 25),
                       command=lambda: algorithm(2, root),
                       width=15,
                       height=2,
                       bg="#F4A460")
    button1_2.place(x=363, y=300)

    button1_3 = Button(root,
                       text="Lz4",
                       font=("宋体", 25),
                       command=lambda: algorithm(3, root),
                       width=15,
                       height=2,
                       bg="#CD5C5C")
    button1_3.place(x=656, y=300)

    button1_4 = Button(root,
                       text="Exit",
                       font=("宋体", 15),
                       command=lambda: sys.exit(),
                       width=5,
                       height=1,
                       bg="#E9967A")
    button1_4.place(x=860, y=600)

    root.mainloop()
示例#21
0
#!/usr/bin/env python

from tkinter import Label, Button, END
from tkinter.tix import Tk, Control, ComboBox

top = Tk()
top.tk.eval('package require Tix')

lb = Label(top, text = 'Animals (in parirs; min : pair, max : dozen)')
lb.pack()

ct = Control(top, label = 'Number:', integer = True, max = 12, min = 2, value = 2, step = 2)
ct.label.config(font = 'Helvetica -14 bold')
ct.pack()

cb = ComboBox(top, label = 'Type:', editable = True)
for animal in ('dog', 'cat', 'hamster', 'python'):
    cb.insert(END, animal)
cb.pack()

qb = Button(top, text = 'Quit', command = top.quit, bg = 'red', fg = 'white')
qb.pack()

top.mainloop()
示例#22
0
from tkinter import Label, Entry, Canvas, Button
from tkinter.tix import Tk

h = Tk()

#creating gui
h.title("Hangman Game")
h.geometry("500x500")
#h.configure(bg = 'white')

label = Label(
    h,
    text="Enter in your guess:",
).place(x=10, y=180)
#label1 = Label(h, bg = 'white', text = "The number of letters in the ranodm word is: %s." %(letterNumberStr))
#label1.place(x = 10, y = 120)

input_box = Entry(h)
input_box.place(x=10, y=200)

#A canvas is needed so I can draw
canvas = Canvas(
    h, bg='white')  # used white background to tell where structure was at
canvas.place(x=325, y=200, width=350, height=50)

canvas.create_line(10, 400, 100, 400)  #scaffoldPart1
canvas.create_line(30, 400, 30, 50)  #scaffoldPart2
canvas.create_line(30, 50, 250, 50)  #scaffoldPart3
canvas.create_line(175, 50, 175, 100)  #rope

h.mainloop()
示例#23
0
                  font=("黑体", 10),
                  width=3,
                  height=2,
                  anchor="center")
    text4.place(x=730, y=380)

    button1_3 = Button(root,
                       text="Return",
                       font=("宋体", 15),
                       command=lambda: location_page(root),
                       width=5,
                       height=1,
                       bg="#48D1CC")
    button1_3.place(x=780, y=600)

    button1_4 = Button(root,
                       text="Exit",
                       font=("宋体", 15),
                       command=lambda: sys.exit(),
                       width=5,
                       height=1,
                       bg="#20B2AA")
    button1_4.place(x=860, y=600)

    root.mainloop()


if __name__ == "__main__":
    fake_root = Tk()
    main_page(fake_root)
示例#24
0
def location_page(root_function_or_final):
    global File_location
    File_location = "null"

    root_function_or_final.destroy()

    root = Tk()
    root.title("A Compressed Software By Wang,Xu,Wu,Huang")
    root.geometry("999x666")
    root.resizable(width=True, height=True)
    root.eval('package require Tix')
    root['bg'] = '#FFFAF0'
    text1 = Label(
        root,
        text="-⭐-Input The Location Of File You Want To Deal With-⭐-",
        bg="#FFFAF0",
        fg="BLACK",
        font=("黑体", 20),
        width=70,
        height=2,
        anchor="center")
    text1.place(x=10, y=40)
    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#D8BFD8",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=70, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#DDA0DD",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=282, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#BA55D3",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=494, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#8B008B",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=706, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#D8BFD8",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=70, y=480)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#DDA0DD",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=282, y=480)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#BA55D3",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=494, y=480)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#8B008B",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=706, y=480)

    location_input = StringVar()
    location_input = Entry(root, bg="#ADD8E6", width=100)
    location_input.place(x=100, y=330)

    button1_3 = Button(root,
                       text="Start",
                       font=("宋体", 10),
                       command=lambda: get_location(root, location_input),
                       width=5,
                       height=1,
                       bg="#AFEEEE")
    button1_3.place(x=866, y=330)

    button1_3 = Button(root,
                       text="Return",
                       font=("宋体", 15),
                       command=lambda: function_page(root),
                       width=5,
                       height=1,
                       bg="#48D1CC")
    button1_3.place(x=780, y=600)

    button1_4 = Button(root,
                       text="Exit",
                       font=("宋体", 15),
                       command=lambda: sys.exit(),
                       width=5,
                       height=1,
                       bg="#20B2AA")
    button1_4.place(x=860, y=600)

    root.mainloop()
示例#25
0
def function_page(root_main_or_ocation):
    global Function_choice
    Function_choice = 0

    root_main_or_ocation.destroy()

    root = Tk()
    root.title("A Compressed Software By Wang,Xu,Wu,Huang")
    root.geometry("999x666")
    root.resizable(width=True, height=True)
    root.eval('package require Tix')
    root['bg'] = '#FFFAF0'
    text1 = Label(root,
                  text="-⭐-Compress Or Uncompress-⭐-",
                  bg="#FFFAF0",
                  fg="BLACK",
                  font=("黑体", 25),
                  width=50,
                  height=2,
                  anchor="center")
    text1.place(x=70, y=40)
    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#D8BFD8",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=70, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#DDA0DD",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=282, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#BA55D3",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=494, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#8B008B",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=706, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#D8BFD8",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=70, y=480)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#DDA0DD",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=282, y=480)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#BA55D3",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=494, y=480)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#8B008B",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=706, y=480)

    button1_1 = Button(root,
                       text="Compress",
                       font=("宋体", 30),
                       command=lambda: function(1, root),
                       width=15,
                       height=2,
                       bg="#87CEEB")
    button1_1.place(x=150, y=300)

    button1_2 = Button(root,
                       text="Uncompress",
                       font=("宋体", 30),
                       command=lambda: function(2, root),
                       width=15,
                       height=2,
                       bg="#4682B4")
    button1_2.place(x=550, y=300)

    button1_3 = Button(root,
                       text="Return",
                       font=("宋体", 15),
                       command=lambda: main_page(root),
                       width=5,
                       height=1,
                       bg="#48D1CC")
    button1_3.place(x=780, y=600)

    button1_4 = Button(root,
                       text="Exit",
                       font=("宋体", 15),
                       command=lambda: sys.exit(),
                       width=5,
                       height=1,
                       bg="#20B2AA")
    button1_4.place(x=860, y=600)

    root.mainloop()
示例#26
0
    bull_bear_days = {
        'bull_days': 0,
        'bear_days': 0,
        'bull_bear': 'bull',
        'bull_bear_day': [
            '2020-01-01',
        ]
    }

    with open('bull_bear_days.json', 'w') as f:
        #    with open('C://Users//faqui//Documents//github//y_Python//bull_bear_days.json', 'w') as f:
        json.dump(bull_bear_days, f)
else:
    pass

root = Tk()  # 初始化Tk()  root便是你布局的根节点了,以后的布局都在它之上

root.title("行者桑结")  # 设置窗口标题

width = root.winfo_reqwidth() + 400  #窗口大小
height = root.winfo_reqheight() + 100  #窗口大小
x, y = (root.winfo_screenwidth() - width) / 2, (root.winfo_screenheight() -
                                                height) / 2
#root.attributes("-toolwindow", 1)  #参数1,设置工具栏样式窗口。#参数1,没有最大化和最小化的按钮。
#root["background"] = "DarkBlue"
root["bd"] = 4
root["relief"] = GROOVE  #RAISED
root.geometry('%dx%d+%d+%d' % (width, height, x, y))  #窗口位置居中,设置窗口大小 注意:是x 不是*

root.resizable(width=True,
               height=True)  # 设置窗口是否可以变化长/宽,False不可变,True可变,默认为True
示例#27
0
def final_page(hint, time):

    root = Tk()
    root.title("A Compressed Software By Wang,Xu,Wu,Huang")
    root.geometry("999x666")
    root.resizable(width=True, height=True)
    root.eval('package require Tix')
    root['bg'] = '#FFFAF0'

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#D8BFD8",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=70, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#DDA0DD",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=282, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#BA55D3",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=494, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#8B008B",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=706, y=200)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#D8BFD8",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=70, y=480)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#DDA0DD",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=282, y=480)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#BA55D3",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=494, y=480)

    imige1 = Label(root,
                   text="-⭐--⭐--⭐--⭐-",
                   bg="#8B008B",
                   fg="#FFFAF0",
                   font=("宋体", 8),
                   width=34,
                   height=1,
                   anchor="center")
    imige1.place(x=706, y=480)

    text1 = Label(root,
                  text=hint,
                  bg="#FFFAF0",
                  fg="BLACK",
                  font=("黑体", 10),
                  width=100,
                  height=2,
                  anchor="center")
    text1.place(x=100, y=300)

    text2 = Label(root,
                  text="程序运行时间:",
                  bg="#FFFAF0",
                  fg="BLACK",
                  font=("黑体", 10),
                  width=100,
                  height=2,
                  anchor="center")
    text2.place(x=100, y=380)

    text3 = Label(root,
                  text=time,
                  bg="#FFFAF0",
                  fg="BLACK",
                  font=("黑体", 10),
                  width=100,
                  height=2,
                  anchor="center")
    text3.place(x=300, y=380)

    text4 = Label(root,
                  text="s",
                  bg="#FFFAF0",
                  fg="BLACK",
                  font=("黑体", 10),
                  width=3,
                  height=2,
                  anchor="center")
    text4.place(x=730, y=380)

    button1_3 = Button(root,
                       text="Return",
                       font=("宋体", 15),
                       command=lambda: location_page(root),
                       width=5,
                       height=1,
                       bg="#48D1CC")
    button1_3.place(x=780, y=600)

    button1_4 = Button(root,
                       text="Exit",
                       font=("宋体", 15),
                       command=lambda: sys.exit(),
                       width=5,
                       height=1,
                       bg="#20B2AA")
    button1_4.place(x=860, y=600)

    root.mainloop()
示例#28
0
    
# -----------------------------------


# ------------------- 浏览器服务设置----------------------
chromedriver = "C:\\Users\\sgm\\Desktop\\sgm\\autoOrderTMall\\chromedriver.exe"
chrome_options = Options()
chrome_options.add_argument("--headless")
chrome_options.add_argument('--disable-gpu')
chrome_options.add_argument('--no-sandbox')
# -------------------------------------------------------

isStart = False
browser = False

root = Tk(); #初始化tk
root.title("create by sgm")    # 设置窗口标题
root.geometry("400x230")    # 设置窗口大小
root.resizable(width=False, height=False) # 设置窗口是否可以变化长/宽,False不可变,True可变,默认为True
# root.tk.eval('package require Tix')  #引入升级包,这样才能使用升级的组合控件

# 提示
labelLink = Label(root, text="网址:", font=("Microsoft YaHei",12), width=8, height=3, anchor=W)
labelLink.grid(row = 0)
# 输入框
entryLink = Entry(root, font=("Microsoft YaHei",12), width=25)
entryLink.grid(row = 0, column = 1)

buttonOpenLink=Button(root,
              text='打开链接',
              command=lambda:threadIt(openLink),
示例#29
0
from tkinter import *
from tkinter.tix import Tk, Control, ComboBox  #升级的组合控件包
from tkinter.messagebox import showinfo, showwarning, showerror  #各种类型的提示框

root = Tk()  # 初始化Tk()
root.title("hello tkinter")  # 设置窗口标题
root.geometry("800x1000")  # 设置窗口大小 注意:是x 不是*
root.resizable(width=True,
               height=True)  # 设置窗口是否可以变化长/宽,False不可变,True可变,默认为True
root.tk.eval('package require Tix')  #引入升级包,这样才能使用升级的组合控件

lable = Label(root,
              text="label",
              bg="pink",
              bd=10,
              font=("Arial", 12),
              width=8,
              height=3)
lable.pack(side=LEFT)

# Booleans
NO = FALSE = OFF = 0
YES = TRUE = ON = 1

# -anchor and -sticky
N = 'n'
S = 's'
W = 'w'
E = 'e'
NW = 'nw'
SW = 'sw'
示例#30
0
from tkinter import *
from tkinter.tix import Tk, Control, ComboBox  # 升级的组合控件包
from tkinter.messagebox import showinfo, showwarning, showerror  #各种类型的提示框


def resize(ev=None):
    lable.config(font='Helvetica -%d bold' % scale.get())


def click():
    print("点击了一次")


if __name__ == "__main__":
    # root是布局的根节点
    root = Tk()  # 初始化tk
    # 设置窗口标题
    root.title("hello tkinter")
    # 设置窗口大小 注意:是X 不是*
    root.geometry("1024x768")
    # 设置窗口是否可以变化长/宽,False不可变,True可变
    root.resizable(width=True, height=True)
    # 引入升级包,这样才能使用升级的组合控件
    root.tk.eval('package require Tix')
    lable = Label(root,
                  text="label",
                  bg="pink",
                  bd=10,
                  font=("Arial", 12),
                  width=8,
                  height=3)