首页
在线工具
统计
Search
1
创建自签名 ssl 证书
140 阅读
2
Windows 11还原右键经典菜单
101 阅读
3
全国DNS服务器IP
79 阅读
4
typecho添加打赏功能
75 阅读
5
躲避校园网客户端的检测实现移动热点开启
72 阅读
随笔杂记
Web建设
运维茶点
编程之路
网络配置指南
Huawei
网络安全
资源下载
登录
Search
标签搜索
Huawei
HCNA
web
Linux
Python
PC
Blog
Network
Virus
DNS
LOVE
Docker
typecho
MySQL
HCNP
Smilinghan
累计撰写
46
篇文章
累计收到
10
条评论
首页
栏目
随笔杂记
Web建设
运维茶点
编程之路
网络配置指南
Huawei
网络安全
资源下载
页面
在线工具
统计
搜索到
5
篇与
的结果
2023-06-04
使用 pyi-set_version 为 Python EXE 文件添加版本信息的方法
在开发软件时,为了方便用户了解软件的版本信息,我们通常会在软件的可执行文件(EXE 文件)中添加版本号等信息。而在 Python 开发中,我们可以使用 pyi-set_version 工具来为 EXE 文件添加版本信息。1. 要使用 pyi-set_version ,您需要先安装PyInstaller。您可以使用pip来安装它。在命Windows 终端(cmd)中输入以下命令:pip install pyinstaller2. 准备我们的 本版内容文件 可以引荐我之前的发布的模板 从 PyInstaller-pyi-grab_version 生成的可执行文件中提取版本信息3. 我们需要在 Windows终端 中进入您要添加版本的程序目录下,执行以下命令操作:pyi-set_version file_version_info.txt yourprogramname.exe打开程序的属性在详细信息就可以查看我们添加的版本信息了。
2023年06月04日
10 阅读
0 评论
1 点赞
2023-06-04
从 PyInstaller-pyi-grab_version 生成的可执行文件中提取版本信息
1. 要使用pyi-grab_version,您需要先安装PyInstaller。您可以使用pip来安装它。在Windows 终端(cmd)中输入以下命令:pip install pyinstaller2. 我们需要在 Windows终端 中进入您要获取版本的程序目录下,执行以下命令操作。pyi-grab_version yourprogramname.exe3.当命令执行完成后,会在目录下生成一个file_version_info.txt名称的文件。# UTF-8 # # For more details about fixed file info 'ffi' see: # http://msdn.microsoft.com/en-us/library/ms646997.aspx VSVersionInfo( ffi=FixedFileInfo( # filevers and prodvers should be always a tuple with four items: (1, 2, 3, 4) # Set not needed items to zero 0. filevers=(1, 0, 0, 0), prodvers=(1, 0, 0, 0), # Contains a bitmask that specifies the valid bits 'flags'r mask=0x16, # Contains a bitmask that specifies the Boolean attributes of the file. flags=0x0, # The operating system for which this file was designed. # 0x4 - NT and there is no need to change it. OS=0x40004, # The general type of file. # 0x1 - the file is an application. fileType=0x1, # The function of the file. # 0x0 - the function is not defined for this fileType subtype=0x0, # Creation date and time stamp. date=(0, 0) ), kids=[ StringFileInfo( [ StringTable( '080404b0', [StringStruct('CompanyName', 'Smilinghan'), StringStruct('FileDescription', 'Smilinghan-PC'), StringStruct('FileVersion', '1.0.0.0'), StringStruct('InternalName', 'Smilinghan-PC.exe'), StringStruct('LegalCopyright', 'Copyright (C) 2023-2023 by Smilinghan (nihaotang.com)'), StringStruct('OriginalFilename', 'Smilinghan-PC'), StringStruct('ProductName', 'Smilinghan-PC'), StringStruct('ProductVersion', '1.0.0.0')]) ]), VarFileInfo([VarStruct('Translation', [2050, 1000])]) ] )
2023年06月04日
7 阅读
0 评论
1 点赞
2023-05-11
爬取图片
爬取星巴克图片但是后面无法下载!from bs4 import BeautifulSoup import urllib.request import os url = 'https://www.starbucks.com.cn/menu/' try: response = urllib.request.urlopen(url) except: print("Error: 无法检索到 URL") exit() content = response.read().decode('utf-8') soup = BeautifulSoup(content, 'lxml') image_list = [(a.find('div', class_='preview')['style'].split('url("')[1].split('")')[0], a.find('strong').text) for a in soup.find_all('a', class_='thumbnail')] folder_path = os.path.join(os.getcwd(), "starbucks") if not os.path.isdir(folder_path): os.makedirs(folder_path) for url, name in image_list: try: urllib.request.urlretrieve(url="https://www.starbucks.com.cn" + url, filename=os.path.join(folder_path, name + '.jpg')) except: print(f"Error: 无法检索到 {name}")
2023年05月11日
30 阅读
2 评论
2 点赞
2023-05-10
Python爬取 淘票票信息
刚入手还没捂热的爬虫,如有不足的地方望大佬指点一番import urllib.request import json import re url = 'https://dianying.taobao.com/showAction.json?_ksTS=1683089742953_64&jsoncallback=jsonp65&action=showAction&n_s=new&event_submit_doGetSoon=true' headers = { 'accept':' text/javascript, application/javascript, application/ecmascript, application/x-ecmascript, */*; q=0.01', 'accept-language':' zh-CN,zh;q=0.9,en;q=0.8', 'cookie':' ', 'referer':' https://dianying.taobao.com/?spm=a1z21.3046609.city.222.32c0112alijvBz&city=441800', 'user-agent':' Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36', 'x-kl-ajax-request':' Ajax_Request', 'x-requested-with':' XMLHttpRequest', } request = urllib.request.Request(url=url, headers=headers) response = urllib.request.urlopen(request) content = response.read().decode('utf-8') # 使用正则表达式提取 JSON 数据 match = re.search(r'\((.*)\)', content) json_data = match.group(1) # 将JSON数据写入文件 with open('D:\\taopiaopiao.json', 'w', encoding='utf-8') as fp: json.dump(json.loads(json_data), fp, ensure_ascii=False) # 从文件中加载 JSON 数据 with open('D:\\taopiaopiao.json', 'r', encoding='utf-8') as fp: obj = json.load(fp) # 打印演出名称和演出时间 for item in obj['returnValue']: print(item['showName'], ":", item['openDay'])
2023年05月10日
14 阅读
0 评论
3 点赞
2023-04-08
pygame 添加背景音乐
from pygame import mixer if __name__ == '__main__': # 音频文件路径 Mp4Path = r"./music/jijitaimei.mp3" mixer.init() # 加载音乐 mixer.music.load(Mp4Path) mixer.music.play(start=0.0) # 音乐停止播放 mixer.music.stop()
2023年04月08日
16 阅读
1 评论
0 点赞