王者荣耀假皮肤软件,王者荣耀沐日漫画-凯发app

王者荣耀假皮肤软件,王者荣耀沐日漫画

凭证 下面的提供的王者荣耀最低战力查询的python源码王者荣耀假皮肤软件,使用pyqt5搭建了一个gui王者荣耀假皮肤软件,同时还可以看每个英雄皮肤的高清图。

私信小编01即可获取大量python学习资源

import requests as rimport randomimport json def getmidstr(txt, txt_start, txt_end='', seeks=0, seeke=0): """取中央 文本函数""" try: if txt_end or seeks or seeke: pass else: raise 1 s_1 = txt.find(txt_start) if s_1 == -1: raise 1 l_1 = len(txt_start) if txt_end: s_2 = txt.find(txt_end, s_1) if s_1 == -1 or s_2 == -1: return false return txt[s_1 l_1:s_2] if seeks: return txt[s_1 - seeks:s_1] if seeke: return txt[s_1 l_1:s_1 l_1 seeke] except exception: return '传参错误或未找到传参文本' while true: hero = input("输入需要查询的英雄:") if hero == "": print("您输入无效") elif hero == "0": exit() else: source = r.get("http://s.wukongfenshen.com:9972/main/api/honour/wzpower/static/js/index.js?v=0." str( random.randint(1000000, 9999999))).text _json = getmidstr(source, "var dictall = ", "}}") "}}" _json = json.loads(_json) try: _json[hero] except keyerror as reason: print("没有英雄:%s" % reason) continue title = _json[hero]["title"] content = _json[hero]["content"] print("英雄:%s" % title) content = str.replace(content, "pp", "\n") content = str.replace(content, "p p", "\n") content = str.replace(content, "/p", "\n") content = str.replace(content, "p", "") print(content "\n")

若是 想替换 主界面配景王者荣耀假皮肤软件,修改第90行的图片路径即可。

pixmap.load("./image/199-bigskin-3.jpg")

搜索框输入想查询的英雄名称王者荣耀假皮肤软件,带有自动补全。英雄查询失败,或者名字不准确 ,则会被提醒

点击搜索,搜索时间有时较长有时较短,我也不知道为什么。效果 界面如下,配景默以为 原皮皮肤,可以移动鼠标位置到缩略图上,即可将该皮肤设置为配景。

点击qq头像即可切换到微信区

鼠标停留在地域上,则会显示所属省份或市级(该功效默认关闭,由于 需挪用 百度舆图api, 使用前要自己去申请响应 的 ak, 申请后将functions文件夹下get_detail_location.py 中的 ak 替换为自己的 ak 即可)

def get_detail_location(place_name): ak = 'ckxxxxxxxxxxxxxxxxxxco9' # 替换为自己申请的ak url = "http://api.map.baidu.com/place/v2/suggestion" \ f"?query={place_name}®ion={place_name}&city_limit=false&output=json&ak={ak}" res = requests.get(url).json() return res['result'][0]['province'] res['result'][0]['city']

焦点python代码王者荣耀假皮肤软件

from multiprocessing import poolimport sysimport timefrom bs4 import beautifulsoupfrom pyqt5.qtgui import qbrush, qicon, qmouseevent, qpalette, qpixmapfrom pyqt5.qtcore import pyqtsignal, qt, qrect, qsize, qthreadfrom pyqt5.qtwidgets import qapplication, qcompleter, qgraphicsopacityeffect, qgroupbox,\ qhboxlayout, qlineedit, qpushbutton, qvboxlayout, qwidgetimport requestsimport sip# 引入自界说组件from custom_widgets.customqlabel import customqlabelfrom custom_widgets.powerdisplayarea import powerdisplayareafrom custom_widgets.skinbox import skinboxfrom custom_widgets.warnmessagebox import warnmessagebox# 引入自界说函数from functions.get_detail_location import get_detail_locationfrom functions.get_heroskin_url import heroskin, download_image_datafrom functions.get_power_information import get_power_info# 读取qss文件并设置stylesheetclass qsstool: @staticmethod def set_qss(obj, filepath): with open(filepath, 'r', encoding='utf-8') as f: style = f.read() obj.setstylesheet(style)class runthread(qthread): """ 该线程用于下载图片数据以及获取地名详情信息 """ _signal = pyqtsignal(object) def __init__(self, hero, qq_info, wx_info): super(runthread, self).__init__() self.hero = hero self.qq_info = qq_info self.wx_info = wx_info def __del__(self): self.wait() def run(self): print('线程最先 ') self.load_data(self.hero, self.qq_info, self.wx_info) def load_data(self, hero, qq_info, wx_info): """ 1. 挪用 heroskin 获取英雄皮肤以及缩略图网址,然后在线程池中下载图片数据 2. 挪用 get_detail_location 补全定位所在省份或者市级 :param hero: :param qq_info: :param wx_info: :return: """ small_skin, big_skin, num = heroskin(hero) # 爬取高清皮肤、缩略图网址,以及皮肤数目 pool = pool(2 * (num-1)) # 使用 线程池下载皮肤高清图以及缩放图数据 rl = pool.map(download_image_data, big_skin small_skin) pool.close() # 关闭历程 池,不再接受新的历程 pool.join() # 主历程 壅闭 期待子历程 的退出 img_data = rl # 补全地域信息 qq_detail_place = [get_detail_location(qq_item['定位']) for qq_item in qq_info] wx_detail_place = [get_detail_location(wx_item['定位']) for wx_item in wx_info] return_data = { 'big_skin': img_data[:num], 'small_skin': img_data[num:], 'qq_detail_place': qq_detail_place, 'wx_detail_place': wx_detail_place, 'qq_info': qq_info, 'wx_info': wx_info, } self._signal.emit(return_data)# 主法式class app(qwidget): def __init__(self, parent=none): super(app, self).__init__(parent) # 应用结构 美化 qsstool.set_qss(self, 'beautify.qss') self.setwindowtitle("王者战力查询") # 设置窗口配景 pixmap = qpixmap() pixmap.load("./image/199-bigskin-3.jpg") pixmap = pixmap.scaled(960, 441, qt.keepaspectratio, qt.smoothtransformation) palette = qpalette() palette.setbrush(qpalette.background, qbrush(pixmap)) self.setpalette(palette) self.mainlayout = qvboxlayout(self) self.mainlayout.setcontentsmargins(0, 0, 0, 0) self.mainlayout.addstretch() # 显示皮肤头像的结构 self.thumbnaillayout = qhboxlayout() self.thumbnaillayout.addstretch() self.smalllayout = qhboxlayout() self.smalllayout.setcontentsmargins(0, 0, 0, 0) self.smalllayout.setspacing(10) self.thumbnaillayout.addlayout(self.smalllayout) self.thumbnaillayout.addstretch() self.mainlayout.addlayout(self.thumbnaillayout) self.setlayout(self.mainlayout) self.container = qgroupbox(self) self.container.setobjectname('container') self.container.setgeometry(qrect(340, 250, 280, 280)) self.lay = qvboxlayout() self.search_box_area = qgroupbox(self) self.search_box_area.setobjectname('searchbox') self.search_box_layout = qhboxlayout() self.search_box_layout.setspacing(0) self.search_box_layout.setcontentsmargins(5, 0, 5, 0) self.channel = customqlabel(self) self.channel.button_clicked_signal.connect(self.channel_changed) self.inputbox = qlineedit(self) self.inputbox.setobjectname('inputbox') self.inputbox.setplaceholdertext('输入英雄名称') self.inputbox.setalignment(qt.aligncenter) self.btn = qpushbutton('', self) self.btn.seticon(qicon('./image/scope1.png')) self.btn.setobjectname('searchbutton') self.btn.seticonsize(qsize(30, 30)) self.btn.setfixedsize(qsize(36, 36)) self.btn.clicked.connect(self.search) self.search_box_layout.addwidget(self.channel) self.search_box_layout.addwidget(self.inputbox) self.search_box_layout.addwidget(self.btn) self.search_box_area.setlayout(self.search_box_layout) layout = qhboxlayout() layout.addstretch() layout.addwidget(self.search_box_area) layout.addstretch() self.lay.addlayout(layout) self.container.setlayout(self.lay) self.lay.addspacing(20) self.wid = powerdisplayarea() self.wid.setinfo('省标') self.lay.addwidget(self.wid) self.wid2 = powerdisplayarea() self.wid2.setinfo('市标') self.lay.addwidget(self.wid2) self.wid3 = powerdisplayarea() self.wid3.setinfo('县标') self.lay.addwidget(self.wid3) self.wid.hide() self.wid2.hide() self.wid3.hide() self.container.setstylesheet(''' qgroupbox{ background-color:transparent; }''') self.status = false self.start() def start(self): url = 'https://pvp.qq.com/web201605/herolist.shtml' headers = { 'content-type': 'text/html', 'user-agent': '''mozilla/5.0 (windows nt 10.0; win64; x64) applewebkit/537.36 (khtml, like gecko) chrome/88.0.4324.190 safari/537.36''' } total_list = requests.get(url, headers) total_list.encoding = 'gbk' soup = beautifulsoup(total_list.text, 'html.parser') hero_names = soup.select('div[class="herolist-content"]') soup2 = beautifulsoup(str(hero_names), 'html.parser') hero_names = soup2.find_all('a') hero_list = [item.get_text() for item in hero_names] # 增添 自动补全 completer = qcompleter(hero_list) # 设置匹配模式 completer.setfiltermode(qt.matchstartswith) # 设置补全模式 completer.setcompletionmode(qcompleter.inlinecompletion) # 给lineedit设置补全器 self.inputbox.setcompleter(completer) def search(self): hero = self.inputbox.text() if hero == "": warnbox = warnmessagebox() warnbox.set_position(self.pos().x() 380, self.pos().y() 145) warnbox.exec_() else: try: self.s1 = time.time() self.setwindowtitle("王者战力查询 (查询中)") qq_info, wx_info = get_power_info(hero) self.thread = runthread(hero, qq_info, wx_info) self.thread._signal.connect(self.call_backlog) # 最先 线程 self.thread.start() except exception as reason: print("没有英雄:%s" % reason) warnbox = warnmessagebox() warnbox.set_position(self.pos().x() 380, self.pos().y() 145) warnbox.exec_() def call_backlog(self, data): self.container.setgeometry(qrect(340, 80, 280, 280)) self.container.setstylesheet('''qgroupbox#container{ background-color:white; border-radius:10px; }''') opacity = qgraphicsopacityeffect() opacity.setopacity(0.7) self.container.setgraphicseffect(opacity) self.inputbox.setstylesheet('''qlineedit#inputbox { border:none; border-right:2px solid #7f7f7f; background-color:transparent; font-size:12pt; font-family:"微软雅黑" color:gray; }''') self.search_box_area.setstylesheet(''' qgroupbox#searchbox{ border:2px solid #7f7f7f; } ''') self.btn.seticon(qicon('./image/scope2.png')) self.qq_info, self.wx_info = data['qq_info'], data['wx_info'] # 设置窗口配景 self.imgdata = data['big_skin'] pixmap = qpixmap() pixmap.loadfromdata(self.imgdata[0]) pixmap = pixmap.scaled(960, 441, qt.keepaspectratio, qt.smoothtransformation) palette = qpalette() palette.setbrush(qpalette.background, qbrush(pixmap)) self.setpalette(palette) # -----------若是 有头像框,刷新前扫除 ------------ for i in reversed(range(self.smalllayout.count())): w = self.smalllayout.itemat(i) w.widget().deletelater() self.smalllayout.removeitem(w) sip.delete(w.widget()) sip.delete(self.smalllayout) self.smalllayout = qhboxlayout() # ----------重新天生 缩略图区--------------------------------- skinbox.numinstance = 0 for i, skin in enumerate(data['small_skin']): self.skinbox = skinbox() self.skinbox.setmousetracking(true) self.skinbox.setobjectname(str(i)) self.skinbox.setskin(skin, 'q' str(i)) self.smalllayout.addwidget(self.skinbox) self.skinbox.num_send_signal.connect(self.get_object_name) self.thumbnaillayout.insertlayout(1, self.smalllayout) # ------获取地域信息--------- self.qq_detailplace = data['qq_detail_place'] self.wx_detailplace = data['wx_detail_place'] # -------设置战力数据-------- self.status = true self.show_information(self.channel.getstatus()) self.wid.show() self.wid2.show() self.wid3.show() self.setwindowtitle("王者战力查询") self.s2 = time.time() print('time', self.s2 - self.s1) del self.thread def channel_changed(self): if self.status: self.show_information(not self.channel.getstatus()) def show_information(self, iswx): if iswx: self.wid.setinfo('省标', self.wx_info[2]['战力'], self.wx_info[2]['定位'], self.wx_info[2]['更新时间'], self.wx_detailplace[2]) self.wid2.setinfo('市标', self.wx_info[1]['战力'], self.wx_info[1]['定位'], self.wx_info[1]['更新时间'], self.wx_detailplace[1]) self.wid3.setinfo('县标', self.wx_info[0]['战力'], self.wx_info[0]['定位'], self.wx_info[0]['更新时间'], self.wx_detailplace[0]) else: self.wid.setinfo('省标', self.qq_info[2]['战力'], self.qq_info[2]['定位'], self.qq_info[2]['更新时间'], self.qq_detailplace[2]) self.wid2.setinfo('市标', self.qq_info[1]['战力'], self.qq_info[1]['定位'], self.qq_info[1]['更新时间'], self.qq_detailplace[1]) self.wid3.setinfo('县标', self.qq_info[0]['战力'], self.qq_info[0]['定位'], self.qq_info[0]['更新时间'], self.qq_detailplace[0]) self.lay.addwidget(self.wid) self.lay.addwidget(self.wid2) self.lay.addwidget(self.wid3) strnum = 0 def get_object_name(self, object_name): """ 1. 凭证 工签字 称,获得 skinbox 中对应缩略图的索引 2. 若是 索引发生改变,则将新的索引值所对应的皮肤设置为当前界面配景 :param object_name: :return: """ list_str = list(object_name) list_str.pop(0) object_name = ''.join(list_str) if int(object_name) != self.strnum: self.strnum = int(object_name) pixmap = qpixmap() pixmap.loadfromdata(self.imgdata[self.strnum]) pixmap = pixmap.scaled(960, 441, qt.keepaspectratio, qt.smoothtransformation) palette = qpalette() palette.setbrush(qpalette.background, qbrush(pixmap)) self.setpalette(palette) else: pass def mousemoveevent(self, a0: qmouseevent): self.setmousetracking(true)if __name__ == "__main__": import ctypes # 解决使命 栏ico无法显示的问题 ctypes.windll.shell32.setcurrentprocessexplicitappusermodelid("myappid") app = qapplication(sys.argv) form = app() form.setfixedsize(960, 441) form.setwindowicon(qicon('image/2021.ico')) form.show() sys.exit(app.exec_())

除非特别注明,本站所有文字均为原创文章,作者:wensenlan女性时尚

网站地图