python 导航框 | 哔哩哔哩推荐100万收藏的导航网页

python 导航框 | 哔哩哔哩推荐100万收藏的导航网页
python 导航框 | 哔哩哔哩推荐100万收藏的导航网页
import tkinter as tk
import time
from tkinter import *
gwin=None
import webbrowser
def cmd(x):

def innerCmd():#innerCmd是个闭包
    if x==0: value=webbrowser.open("https://www.52pojie.cn/") #吾爱破解
    elif x==1: value=webbrowser.open("https://www.csdn.net/") #CSDN
    elif x==2: value=webbrowser.open("http://www.turingapi.com/") #图灵机器人
    elif x==3: value=webbrowser.open("https://mirrors.tuna.tsinghua.edu.cn/") #清华大学开源软件镜像站
    elif x==4: value=webbrowser.open("https://www.arduino.cn/") #Arduino中文社区
    elif x==5: value=webbrowser.open("https://yz.chsi.com.cn/apply/main.do") #全国硕士研究生招生考试网上报名平台
    elif x==6: value=webbrowser.open("http://www.xue51.com/") #软件学堂
    elif x==7: value=webbrowser.open("https://www.beiwaiclass.com/") #北外网课
    elif x==8: value=webbrowser.open("https://www.icourse163.org/") #中国大学MOOC
    elif x==9: value=webbrowser.open("https://python123.io/") #Python123
    elif x == 10:value = webbrowser.open("https://blog.gitee.com/")  # PGitee 官方博客
    elif x == 11: value = webbrowser.open("https://www.w3school.com.cn/")  # w3school
    elif x == 12: value = webbrowser.open("https://cli.im/deqr")  # 草料二维码
    elif x==13: value=webbrowser.open("http://www.cpta.com.cn/index.html") #中国人事考试网
    elif x==14: value=webbrowser.open("http://fanyi.youdao.com/") #有道翻译

    #print(x, value, type(value))
return innerCmd

def cmk(n):

def innerCmk():#innerCmk是个闭包
    if n==0: value1=webbrowser.open("https://www.pantone.com/") #PANTONE潘通色彩
    elif n==1: value1=webbrowser.open("https://www.red-dot.org/") #红点设计奖
    elif n==2: value1=webbrowser.open("https://www.idsa.org/") #美国工业设计师协会-IDSA
    elif n==3: value1=webbrowser.open("https://ifworlddesignguide.com/") #iF世界设计指数
    elif n==4: value1=webbrowser.open("http://www.tuke88.com/") #图客巴巴
    elif n==5: value1=webbrowser.open("https://www.gracg.com/") #涂鸦王国
    elif n==6: value1=webbrowser.open("https://dl.58pic.com/") #千图网
    elif n==7: value1=webbrowser.open("https://graph.baidu.com/pcpage/index?tpl_from=pc") #百度识图
    elif n==8: value1=webbrowser.open("https://xiumi.us/studio/v5#/paper/for/new/cube/0") #秀米图文排版

    #print(n, value1, type(value1))
return innerCmk

def cmj(y):

def innerCmj():#innerCmj是个闭包
    if y==0: value2=webbrowser.open("https://v.qq.com/") #腾讯视频
    elif y==1: value2=webbrowser.open("https://www.iqiyi.com/") #爱奇艺
    elif y==2: value2=webbrowser.open("https://www.mgtv.com/") #芒果TV
    elif y==3: value2=webbrowser.open("https://www.bilibili.com/") #哔哩哔哩


    #print(y, value2, type(value2))
return innerCmj

def cmz(z):

def innerCmz():#innerCmz是个闭包
    if z==0: value3=webbrowser.open("https://www.xue8nav.com/") #学吧导航
    elif z==1: value3=webbrowser.open("https://www.sciping.com/") #科塔学术
    elif z==2: value3=webbrowser.open("http://www.hippter.com/") #HiPPTer ppt素材
    elif z==3: value3=webbrowser.open("https://www.seeseed.com/") #seeseed设计素材
    elif z==4: value3=webbrowser.open("http://www.chuangzaoshi.com/") #创造狮导航
    elif z==5: value3=webbrowser.open("https://www.addog.vip/") #adddog(广告营销工具)
    elif z==6: value3=webbrowser.open("http://hao.199it.com//") #199it(大数据)
    elif z==7: value3=webbrowser.open("http://www.dajiadaohang.com/") #打假导航(*部门导航)
    elif z==8: value3=webbrowser.open("https://aur.one/") #一个开始(综合素材检索)
    elif z==9: value3=webbrowser.open("https://www.chongbuluo.com/") #虫部落
    elif z==10:value3 = webbrowser.open("https://www.chongbuluo.com/")  # ***
    elif z==11: value3 = webbrowser.open("https://www.w3school.com.cn/")  # **
    elif z==12: value3 = webbrowser.open("https://cli.im/deqr")  # ***
    elif z==13: value3=webbrowser.open("http://www.cpta.com.cn/index.html") #***
    elif z==14: value3=webbrowser.open("http://fanyi.youdao.com/") #***

    #print(z, value3, type(value3))
return innerCmz

def main():
global gwin
gwin=tk.Tk()

gwin.titles1=["吾爱破解","CSDN","图灵机器人", "清华大学开源软件镜像站", "Arduino中文社区",
             "全国硕士研究生招生报名","软件学堂", "北外网课", "中国大学MOOC", "Python123",
             "Gitee 官方博客","w3school","草料二维码","中国人事考试网", "有道翻译"]
gwin.titles2 = ["PANTONE潘通色彩", "红点设计奖", "美国工业设计师协会-IDSA ", "iF世界设计指数", "图客巴巴",
               "涂鸦王国", "千图网", "百度识图","秀米图文排版"]
gwin.titles3 = ["腾讯视频", "爱奇艺", "芒果TV","哔哩哔哩"]
gwin.titles4 = ["学吧导航", "科塔学术", "HiPPTer(PPT素材)", "seeseed设计素材","创造狮导航(设计开发工具)","adddog(广告营销工具)","199it(大数据)",
                "打假导航(*部门导航)","一个开始(综合素材)","虫部落"]

#gwin 的0行0列,title:DYW 学习的 python 相关网站
gwin.lbHint = tk.Label(gwin, text=" → python 相关网站 ", bg="#0b2e50", fg="#ebe2b7", font=('微软雅黑', 14, "bold"))
gwin.lbHint.grid(row=0, column=0, columnspan=3, sticky="WE")  #
# gwin 的1行0列 frk 组合框
frk = tk.Frame(gwin)
frk.grid(row=1, column=0)
for k in range(15):
    button=tk.Button(frk,text=gwin.titles1[k],bg = "#e2dcca", fg = "#064b82",font = ('微软雅黑',14,"bold"),command=cmd(k))
    button.grid(row=k//5,column=k%5,padx=5,pady=5,sticky="WE")

# gwin 的2行0列,空格一行
gwin.lbHint = tk.Label(gwin, text=" ")  # 加入一排空格行
gwin.lbHint.grid(row=2, column=0, columnspan=3, sticky="W")

# gwin 的3行0列:title:DYW 学习的色彩网站
gwin.lbHint = tk.Label(gwin, text=" → 色彩网站 ", bg="#ff8d54", fg="#ebe2b7", font=('微软雅黑', 14, "bold"))
gwin.lbHint.grid(row=3, column=0, columnspan=3, sticky="WE")  #
# gwin 的4行0列 frm 组合框
frm = tk.Frame(gwin)
frm.grid(row=4, column=0)
for m in range(9):
    button=tk.Button(frm,text=gwin.titles2[m],bg = "#e2dcca", fg = "#ff8d54",font = ('微软雅黑',14,"bold"),command=cmj(m)) #咖啡底色,白字
    button.grid(row=m//5,column=m%5,padx=5,pady=5,sticky="WE")


# gwin 的5行0列,空格一行
gwin.lbHint = tk.Label(gwin, text=" ")  # 加入一排空格行
gwin.lbHint.grid(row=5, column=0, columnspan=3, sticky="W")

# gwin 的6行0列:title:视频网站
gwin.lbHint = tk.Label(gwin, text=" → 视频网站 ", bg="#80d480", fg="#ebe2b7", font=('微软雅黑', 14, "bold"))
gwin.lbHint.grid(row=6, column=0, columnspan=3, sticky="WE")  #
# gwin 的7行0列 frj 组合框
frj = tk.Frame(gwin)
frj.grid(row=7, column=0)
for j in range(4):
    button = tk.Button(frj, text=gwin.titles3[j], bg="#e2dcca", fg="#80d480", font=('微软雅黑', 14, "bold"), command=cmj(j))  # 咖啡底色,白字
    button.grid(row=j//5, column=j % 5, padx=5, pady=5, sticky="WE")
gwin.columnconfigure(0, weight=1)

# gwin 的8行0列,空格一行
gwin.lbHint = tk.Label(gwin, text=" ")  # 加入一排空格行
gwin.lbHint.grid(row=8, column=0, columnspan=3, sticky="W")

# gwin 的9行0列:title:哔哩哔哩 推荐网站
gwin.lbHint = tk.Label(gwin, text=" → 哔哩哔哩 推荐网站(100万人收藏) ", bg="#5e5b60", fg="#ebe2b7", font=('微软雅黑', 14, "bold"))
gwin.lbHint.grid(row=9, column=0, columnspan=3, sticky="WE")  #

# gwin 的10行0列 frj 组合框
frz = tk.Frame(gwin)
frz.grid(row=10, column=0)
for z in range(10):
    button = tk.Button(frz, text=gwin.titles4[z], bg="#e2dcca", fg="#5e5b60", font=('微软雅黑', 14, "bold"), command=cmz(z))  # 咖啡底色,白字
    button.grid(row=z // 5, column=z % 5, padx=5, pady=5, sticky="WE")
gwin.columnconfigure(0, weight=1)

# gwin 的11行0列,版本;11行1列,时间
gwin.lbHint = tk.Label(gwin, text="DYW 最新版本 : V 1.0 修改时间:2021-2-20  初始时间:2021-2-20 ")  # 加入版本说明,摆放左边
gwin.lbHint.grid(row=11, column=0, columnspan=3, sticky="W")
gwin.lbHint = tk.Label(gwin, text=time.strftime("%Y-%m-%d %H:%M", time.localtime()))  # 加入时间,摆放右边
gwin.lbHint.grid(row=11, column=1, columnspan=3, sticky="E")
gwin.mainloop()

main()

上一篇:蓝桥杯:迷宫————Python


下一篇:LQBv45-Python:迷宫