参考文档:http://effbot.org/tkinterbook/

参考  哔哩哔哩小助手程序

运行代码:

#BiliTkinterimport tkinter as tk
import requests
import json
from PIL import Image,ImageTk
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import rcParams
from BilibiliSpider import headers,JsonParse,WebDownloader,UrlFactory,AnalyseAclass BiliWindow:def __init__(self,master,dict_json):self.master = masterself.dict_json = dict_jsonself.getSearch = None                #获取搜索输入self.getEntry = tk.StringVar()     #监听entry框中变量值def create_frame(self,dict_json,picture_lpath,picture_path,picanalysis_lpath,picanalysis_path):#第一框架frame = tk.Frame(self.master)frame.pack(side=tk.TOP,anchor=tk.N,padx=20,pady=120)##搜索框entry = tk.Entry(frame,width=50,highlightthickness=2,textvariable=self.getEntry)entry.pack(side=tk.LEFT,ipady=5)##按钮def search():x = 0list = [self.tt,self.at,self.st,self.det,self.pt,self.lt,self.cot,self.sht,self.rt,self.dt,self.ct]for i in list:i.delete(1.0,tk.END)self.getSearch = entry.get()       #获取搜索值url = UrlFactory.UrlFactory().getUrlJson(self.getSearch)    #从工厂得到链接r = requests.get(url,headers=headers).json()JsonParse.JsonParse().parseJsonList(self.dict_json,r)        #生成视频信息字典purl = JsonParse.JsonParse().parseJsonImage(r)            #获取视频图片链接pic = requests.get(purl).content#保存图片with open(picture_lpath,'wb') as f:f.write(pic)for i in dict_json:if x <=11:list[x].insert(tk.END,dict_json[i])            #信息导入textx += 1p = getTextValue(self.pt)            #播放l = getTextValue(self.lt)            #点赞co = getTextValue(self.cot)          #收藏sh = getTextValue(self.sht)          #分享r = getTextValue(self.rt)            #评论c = getTextValue(self.ct)            #硬币#print(p)#生成数据雷达图AnalyseA.AnalyseA().draw_analyse(p,l,co,sh,r,c)refactor(picture_lpath,picture_path,220,180)refactor(picanalysis_lpath,picanalysis_path,417,300)self.createImage(picture_path,picanalysis_path)button = tk.Button(frame,text="s",width=3,height=1,command=search)button.pack(padx=10,pady=3)#第二框架group = tk.Frame(self.master)group.pack()match1 = tk.LabelFrame(group,text="视频信息",padx=5,pady=8)match1.pack(side="left")match2 = tk.LabelFrame(group,text="信息分析图",pady=18)match2.pack()#massage##picturep = tk.Label(match1,width=30,height=10,bg="LightPink")p.grid(row=0,column=0,rowspan=5,columnspan=3, \sticky=tk.W+tk.E+tk.N+tk.S)self.pblock = tk.Canvas(p,width=30,height=10,bg="white")##titlet = tk.Label(match1,width=5,height=2,text="名称:")t.grid(row=0,column=3)self.tt = tk.Text(match1,width=10,height=2)self.tt.grid(row=0,column=4,columnspan=2)##coinc = tk.Label(match1,width=5,height=2,text="硬币数:")c.grid(row=0,column=6)self.ct = tk.Text(match1,width=10,height=1)self.ct.grid(row=0,column=7,columnspan=2)##sorts = tk.Label(match1,width=5,height=2,text="分类:")s.grid(row=1,column=3)self.st = tk.Text(match1,width=10,height=1)self.st.grid(row=1,column=4,columnspan=2)##aida = tk.Label(match1,width=5,height=2,text="AV:")a.grid(row=1,column=6)self.at = tk.Text(match1,width=10,height=1)self.at.grid(row=1,column=7,columnspan=2)##playp = tk.Label(match1,width=5,height=2,text="播放量:")p.grid(row=2,column=3)self.pt = tk.Text(match1,width=10,height=1)self.pt.grid(row=2,column=4,columnspan=2)##likel = tk.Label(match1,width=5,height=2,text="点赞数:")l.grid(row=2,column=6)self.lt = tk.Text(match1,width=10,height=1)self.lt.grid(row=2,column=7,columnspan=2)##shares = tk.Label(match1,width=5,height=2,text="分享数:")s.grid(row=3,column=3)self.sht = tk.Text(match1,width=10,height=1)self.sht.grid(row=3,column=4,columnspan=2)##collectc = tk.Label(match1,width=5,height=2,text="收藏数:")c.grid(row=3,column=6)self.cot = tk.Text(match1,width=10,height=1)self.cot.grid(row=3,column=7,columnspan=2)##replyr = tk.Label(match1,width=5,height=2,text="评论数:")r.grid(row=4,column=3)self.rt = tk.Text(match1,width=10,height=1)self.rt.grid(row=4,column=4,columnspan=2)##danmakud = tk.Label(match1,width=5,height=2,text="弹幕数:")d.grid(row=4,column=6)self.dt = tk.Text(match1,width=10,height=1)self.dt.grid(row=4,column=7,columnspan=2)##detailde = tk.Label(match1,width=6,height=2,text="视频简介")de.grid(row=5,column=0)self.det = tk.Text(match1,width=60,height=6)self.det.grid(row=6,column=0,rowspan=3,columnspan=9,pady=5)#radar##mapm = tk.Label(match2,width=60,height=18,bg="LightPink")m.grid(sticky=tk.W+tk.E+tk.N+tk.S,padx=5)self.mblock = tk.Canvas(m,width=60,height=18,bg="white")def createImage(self,picture_path,picanalysis_path):picture = ImageTk.PhotoImage(file=picture_path)self.pblock.create_image(110,97,image=picture)   #图片位置self.pblock.pack(ipadx=92,ipady=91)              #画布内距picanalyse = ImageTk.PhotoImage(file=picanalysis_path)self.mblock.create_image(211,154,image=picanalyse)self.mblock.pack(ipadx=180,ipady=143)self.master.mainloop()#根据自定义大小截取图片
def refactor(start_path,new_path,x,y):img = Image.open(start_path) img = img.resize((x,y),Image.ANTIALIAS)img.save(new_path,quality=96)#获取text中的信息,并以基本数据类型返回
def getTextValue(a):i = int(a.get("0.0","end").replace(" ",""))return i

实际运行效果图:

哔哩哔哩小助手(GUI)相关推荐

  1. 哔哩哔哩助手edge或chrome插件安装使用教程

    bilibili弹幕视频网现为国内最大的年轻人潮流文化娱乐社区.今天小编为大家带来的是一款可以帮助用户解决观看B站视频的多功能谷歌(Chrome)内核浏览器插件--哔哩哔哩助手(bilibili he ...

  2. python爬取哔哩哔哩视频_荐爬取哔哩哔哩中的cosplay小视频

    爬取哔哩哔哩小视频 前言:想必大家都对小视频感兴趣吧,今天的爬虫的内容为将哔哩哔哩中的视频下载到本地,今天爬取的网站为 URL : https://vc.bilibili.com/p/eden/all ...

  3. 仿哔哩哔哩视频app小程序模板源码

    粉色的哔哩哔哩手机视频网页,多媒体视频类微信小程序ui前端模板下载.包含:视频主页和播放详情页. 小程序源码下载地址: https://download.csdn.net/download/muyes ...

  4. B站哔哩哔哩21届秋招算法岗笔试 假设货币系统包含面值1元、4元、16元、64元共计4种硬币,以及面值1024元的纸币。现在小明使用1024元的纸币购买了一件价值为N(0<N<=1024)的商品

    哔哩哔哩21届秋招算法岗笔试 题目描述: 假设货币系统包含面值1元.4元.16元.64元共计4种硬币,以及面值1024元的纸币.现在小明使用1024元的纸币购买了一件价值为N(0<N<=1 ...

  5. 微信小程序仿哔哩哔哩视频组件

    微信小程序视频组件仿照哔哩哔哩 微信小程序仿照哔哩哔哩(包含源码获取) 效果如下图 一.项目介绍 项目为简单的小程序代码片段,不包含后端,只通过原生的小程序语言开发,使用官方原生的 video,没有使 ...

  6. Python:哔哩哔哩B站视频下载,我终于对小破站下手了

    前言 众所周知,B站的视频是以Blob的方式分断传输视频的,网上也有很多使用拼接视频来达到下载的目的的,但是这样的效率很低,这篇文章提供了三种其它的思路去下载小破站的视频. 开发环境 python 3 ...

  7. 高瓴资本持仓情况曝光:重新买入小鹏、蔚来,大幅减持哔哩哔哩

    日前,高瓴资本在美国证券交易委员会(SEC)披露了其2021年一季度美股持仓情况.截至2021年第一季度末,高瓴资本在美股市场共持有91家公司的股份,总市值为101亿美元. 贝多财经了解到,中概股依然 ...

  8. 哔哩哔哩淘宝小程序盲盒抽奖实践

    目录 背景 名词解释 整体业务流程 技术实现 调用链路 云开发( Serverless ) 云开发的限制 编写云函数 怎么拿到授权查询轻店铺用户订单 轻店铺云网关 数字签名网关 网关技术选型 Vert ...

  9. 小程序实战--仿bilibil(哔哩哔哩)小程序

    项目预览图 小程序?大改变? 之前就被朋友安利使用小程序,最近接近了小程序,发现了它竟然带来了一场"大革命". 简单说,它就是一个可以实现之前只能是原生态APP可以实现的效果和功能 ...

最新文章

  1. explorer.exe应用程序错误说明 0X000000该内存不能为read的解决方法
  2. linux run文件夹,Linux下运行run文件
  3. [数据库]简单SQL语句总结
  4. Linux下为文件增加列的shell脚本
  5. oracle密码文件认证,Oracle OS认证与口令文件认证详解
  6. 计算机系统优化的目的和原理,优化原理
  7. MySQL Root密码丢失解决方法总结
  8. poj1068Parencodings
  9. ubuntu服务器无法运行chromedriver解决方法(转)
  10. WINDOWS NT/2000下如何屏蔽CTRL+ALT+DEL
  11. js如何准确获取当前页面url网址信息
  12. jQ实现简单放大镜效果
  13. IT信息考证人,证书记得要延续 ITSS CISAW CISP PMP CISSP 证书延续 有效期
  14. <a name=“maodian“>锚点标签
  15. 支付宝AR红包引出Python中的PIL小试
  16. 我曾被stormzhang拉黑过
  17. python实现井字棋
  18. Tomcat简介(转)
  19. Python之父吉多·范罗苏姆谈中国的996工作制度
  20. Spyder编辑器配色方案

热门文章

  1. 新闻众筹前途迷茫 但值得深究
  2. 攻防世界-杂项-新手-掀桌子
  3. 微信网页和app内h5页获取当前定位保持一致
  4. JavaScript获取当前年月日,时分秒。
  5. SpringCloud之Ribbon简单入门
  6. c语言坦克大战源代码vc 6.0,坦克大战(VC6.0) - 源码下载|源代码 - 源码中国
  7. 卖油翁 欧阳修 无他,但手熟尔
  8. 全网最全、最新MyBatis框架核心知识,这篇文章包你这辈子也忘不掉MyBatis!!
  9. zabbix硬件dell服务器监控
  10. 计算机二级使用宏,【二级Office】Word控件、宏功能的简单运用