Example #1
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()
Example #2
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()
Example #3
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()
Example #4
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()