【Python】GUI开发笔记

news/2024/7/6 10:37:01/文章来源:https://www.cnblogs.com/mindzone/p/18280721

 

一、环境搭建:

1、Pycharm开发工具

pycharm历史版本
https://www.jetbrains.com/pycharm/download/other.html破解插件
https://blog.csdn.net/weixin_50737119/article/details/135628513

 

2、PYENV 版本管理

Python也有对应的版本管理工具,叫pyenv

这个东西挺奇怪的,直接发布的源码,不是安装包

https://github.com/pyenv-win/pyenv-win/releases

  

环境变量直接绑定到bin目录下,会发现pyenv会推荐让你配置这三个变量

C:\Users\Administrator>pyenv --version
PYENV variable is not set, recommended to set the variable.
PYENV_ROOT variable is not set, recommended to set the variable.
PYENV_HOME variable is not set, recommended to set the variable.
pyenv 3.1.1

 

其实配置第一个就可以了

系统变量新建一个KV对的变量,Key值为 PYENV
D:\pyenv-win-3.1.1\pyenv-win然后在系统变量Path中追加
%PYENV%\bin
%PYENV%\shims

  

默认的镜像源提供的版本有限,这里参考知乎的博客:

https://zhuanlan.zhihu.com/p/597559112 

windows配置pyenv镜像源:

系统变量新建一个kv对变量,key值为 PYTHON_BUILD_MIRROR_URL
https://jedore.netlify.app/tools/python-mirrors/

 

2-1、Python本体下载

 要是不需要频繁切换版本,可以直接下载本体就好了

https://www.python.org/downloads/

 

3、GUI开发库支持

安装python后使用pip包管理工具下载

pip install PyQt6 -i https://pypi.tuna.tsinghua.edu.cn/simple/
pip install PyQt6-tools  -i https://pypi.tuna.tsinghua.edu.cn/simple/

 如果清华镜像源不行(联通网无法连接教育网导致),改用其他源,或者不使用

http://mirrors.aliyun.com/pypi/simple/http://pypi.mirrors.ustc.edu.cn/simple/http://pypi.douban.com/simple/

 

3-1、打包工具库

pip install pyinstaller -i https://pypi.tuna.tsinghua.edu.cn/simple/

  

 

4、配置PyQT和Pycharm的交互

https://blog.csdn.net/pyscl01/article/details/131522183/

 

五、源码打包

打包成可执行文件exe

需要pyinstalller库的支持,先看命令有什么

C:\Users\Administrator\PycharmProjects\pythonProject> pyinstaller -h 
usage: pyinstaller [-h] [-v] [-D] [-F] [--specpath DIR] [-n NAME] [--contents-directory CONTENTS_DIRECTORY] [--add-data SOURCE:DEST][--add-binary SOURCE:DEST] [-p DIR] [--hidden-import MODULENAME] [--collect-submodules MODULENAME] [--collect-data MODULENAME]  [--collect-binaries MODULENAME] [--collect-all MODULENAME] [--copy-metadata PACKAGENAME][--recursive-copy-metadata PACKAGENAME] [--additional-hooks-dir HOOKSPATH] [--runtime-hook RUNTIME_HOOKS][--exclude-module EXCLUDES] [--splash IMAGE_FILE] [-d {all,imports,bootloader,noarchive}] [--optimize LEVEL][--python-option PYTHON_OPTION] [-s] [--noupx] [--upx-exclude FILE] [-c] [-w][--hide-console {hide-late,minimize-early,hide-early,minimize-late}][-i <FILE.ico or FILE.exe,ID or FILE.icns or Image or "NONE">] [--disable-windowed-traceback] [--version-file FILE][-m <FILE or XML>] [-r RESOURCE] [--uac-admin] [--uac-uiaccess] [--argv-emulation] [--osx-bundle-identifier BUNDLE_IDENTIFIER]  [--target-architecture ARCH] [--codesign-identity IDENTITY] [--osx-entitlements-file FILENAME] [--runtime-tmpdir PATH][--bootloader-ignore-signals] [--distpath DIR] [--workpath WORKPATH] [-y] [--upx-dir UPX_DIR] [--clean] [--log-level LEVEL]     scriptname [scriptname ...]positional arguments:scriptname            Name of scriptfiles to be processed or exactly one .spec file. If a .spec file is specified, most options are unnecessary  and are ignored.options:-h, --help            show this help message and exit-v, --version         Show program version info and exit.--distpath DIR        Where to put the bundled app (default: ./dist)--workpath WORKPATH   Where to put all the temporary work files, .log, .pyz and etc. (default: ./build)-y, --noconfirm       Replace output directory (default: SPECPATH\dist\SPECNAME) without asking for confirmation--upx-dir UPX_DIR     Path to UPX utility (default: search the execution path)--clean               Clean PyInstaller cache and remove temporary files before building.--log-level LEVEL     Amount of detail in build-time console messages. LEVEL may be one of TRACE, DEBUG, INFO, WARN, DEPRECATION, ERROR, FATAL   (default: INFO). Also settable via and overrides the PYI_LOG_LEVEL environment variable.What to generate:-D, --onedir          Create a one-folder bundle containing an executable (default)-F, --onefile         Create a one-file bundled executable.--specpath DIR        Folder to store the generated spec file (default: current directory)-n NAME, --name NAME  Name to assign to the bundled app and spec file (default: first script's basename)--contents-directory CONTENTS_DIRECTORYFor onedir builds only, specify the name of the directory in which all supporting files (i.e. everything except the        executable itself) will be placed in. Use "." to re-enable old onedir layout without contents directory.What to bundle, where to search:--add-data SOURCE:DESTAdditional data files or directories containing data files to be added to the application. The argument value should be    in form of "source:dest_dir", where source is the path to file (or directory) to be collected, dest_dir is thedestination directory relative to the top-level application directory, and both paths are separated by a colon (:). To     put a file in the top-level application directory, use . as a dest_dir. This option can be used multiple times.--add-binary SOURCE:DESTAdditional binary files to be added to the executable. See the ``--add-data`` option for the format. This option can be    used multiple times.-p DIR, --paths DIR   A path to search for imports (like using PYTHONPATH). Multiple paths are allowed, separated by ``';'``, or use this        option multiple times. Equivalent to supplying the ``pathex`` argument in the spec file.--hidden-import MODULENAME, --hiddenimport MODULENAMEName an import not visible in the code of the script(s). This option can be used multiple times.--collect-submodules MODULENAMECollect all submodules from the specified package or module. This option can be used multiple times.--collect-data MODULENAME, --collect-datas MODULENAMECollect all data from the specified package or module. This option can be used multiple times.--collect-binaries MODULENAMECollect all binaries from the specified package or module. This option can be used multiple times.--collect-all MODULENAMECollect all submodules, data files, and binaries from the specified package or module. This option can be used multiple    times.--copy-metadata PACKAGENAMECopy metadata for the specified package. This option can be used multiple times.--recursive-copy-metadata PACKAGENAMECopy metadata for the specified package and all its dependencies. This option can be used multiple times.--additional-hooks-dir HOOKSPATHAn additional path to search for hooks. This option can be used multiple times.--runtime-hook RUNTIME_HOOKSPath to a custom runtime hook file. A runtime hook is code that is bundled with the executable and is executed before any  other code or module to set up special features of the runtime environment. This option can be used multiple times.        --exclude-module EXCLUDESOptional module or package (the Python name, not the path name) that will be ignored (as though it was not found). This    option can be used multiple times.--splash IMAGE_FILE   (EXPERIMENTAL) Add an splash screen with the image IMAGE_FILE to the application. The splash screen can display progress   updates while unpacking.How to generate:-d {all,imports,bootloader,noarchive}, --debug {all,imports,bootloader,noarchive}Provide assistance with debugging a frozenapplication. This argument may be provided multipletimes to select several of the following options.- all: All three of the following options.- imports: specify the -v option to the underlyingPython interpreter, causing it to print a messageeach time a module is initialized, showing theplace (filename or built-in module) from which itis loaded. Seehttps://docs.python.org/3/using/cmdline.html#id4.- bootloader: tell the bootloader to issue progressmessages while initializing and starting thebundled app. Used to diagnose problems withmissing imports.- noarchive: instead of storing all frozen Pythonsource files as an archive inside the resultingexecutable, store them as files in the resultingoutput directory.--optimize LEVEL      Bytecode optimization level used for collected python modules and scripts. For details, see the section “BytecodeOptimization Level” in PyInstaller manual.--python-option PYTHON_OPTIONSpecify a command-line option to pass to the Python interpreter at runtime. Currently supports "v" (equivalent to "--      debug imports"), "u", "W <warning control>", "X <xoption>", and "hash_seed=<value>". For details, see the section"Specifying Python Interpreter Options" in PyInstaller manual.-s, --strip           Apply a symbol-table strip to the executable and shared libs (not recommended for Windows)--noupx               Do not use UPX even if it is available (works differently between Windows and *nix)--upx-exclude FILE    Prevent a binary from being compressed when using upx. This is typically used if upx corrupts certain binaries during      compression. FILE is the filename of the binary without path. This option can be used multiple times.Windows and Mac OS X specific options:-c, --console, --nowindowedOpen a console window for standard i/o (default). On Windows this option has no effect if the first script is a '.pyw'     file.-w, --windowed, --noconsoleWindows and Mac OS X: do not provide a console window for standard i/o. On Mac OS this also triggers building a Mac OS     .app bundle. On Windows this option is automatically set if the first script is a '.pyw' file. This option is ignored on   *NIX systems.--hide-console {hide-late,minimize-early,hide-early,minimize-late}Windows only: in console-enabled executable, have bootloader automatically hide or minimize the console window if the      program owns the console window (i.e., was not launched from an existing console window).-i <FILE.ico or FILE.exe,ID or FILE.icns or Image or "NONE">, --icon <FILE.ico or FILE.exe,ID or FILE.icns or Image or "NONE">FILE.ico: apply the icon to a Windows executable. FILE.exe,ID: extract the icon with ID from an exe. FILE.icns: apply the  icon to the .app bundle on Mac OS. If an image file is entered that isn't in the platform format (ico on Windows, icns on  Mac), PyInstaller tries to use Pillow to translate the icon into the correct format (if Pillow is installed). Use "NONE"   to not apply any icon, thereby making the OS show some default (default: apply PyInstaller's icon). This option can be     used multiple times.--disable-windowed-tracebackDisable traceback dump of unhandled exception in windowed (noconsole) mode (Windows and macOS only), and instead display   a message that this feature is disabled.Windows specific options:--version-file FILE   Add a version resource from FILE to the exe.-m <FILE or XML>, --manifest <FILE or XML>Add manifest FILE or XML to the exe.-r RESOURCE, --resource RESOURCEAdd or update a resource to a Windows executable. The RESOURCE is one to four items, FILE[,TYPE[,NAME[,LANGUAGE]]]. FILE   can be a data file or an exe/dll. For data files, at least TYPE and NAME must be specified. LANGUAGE defaults to 0 or may  be specified as wildcard * to update all resources of the given TYPE and NAME. For exe/dll files, all resources from FILE  will be added/updated to the final executable if TYPE, NAME and LANGUAGE are omitted or specified as wildcard *. This      option can be used multiple times.--uac-admin           Using this option creates a Manifest that will request elevation upon application start.--uac-uiaccess        Using this option allows an elevated application to work with Remote Desktop.Mac OS specific options:--argv-emulation      Enable argv emulation for macOS app bundles. If enabled, the initial open document/URL event is processed by thebootloader and the passed file paths or URLs are appended to sys.argv.--osx-bundle-identifier BUNDLE_IDENTIFIERMac OS .app bundle identifier is used as the default unique program name for code signing purposes. The usual form is a    hierarchical name in reverse DNS notation. For example: com.mycompany.department.appname (default: first script'sbasename)--target-architecture ARCH, --target-arch ARCHTarget architecture (macOS only; valid values: x86_64, arm64, universal2). Enables switching between universal2 and        single-arch version of frozen application (provided python installation supports the target architecture). If not target   architecture is not specified, the current running architecture is targeted.--codesign-identity IDENTITYCode signing identity (macOS only). Use the provided identity to sign collected binaries and generated executable. If      signing identity is not provided, ad-hoc signing is performed instead.--osx-entitlements-file FILENAMEEntitlements file to use when code-signing the collected binaries (macOS only).Rarely used special options:--runtime-tmpdir PATHWhere to extract libraries and support files in `onefile` mode. If this option is given, the bootloader will ignore any    temp-folder location defined by the run-time OS. The ``_MEIxxxxxx``-folder will be created here. Please use this option    only if you know what you are doing. Note that on POSIX systems, PyInstaller's bootloader does NOT perform shell-style     environment variable expansion on the given path string. Therefore, using environment variables (e.g., ``~`` or``$HOME``) in path will NOT work.--bootloader-ignore-signalsTell the bootloader to ignore signals rather than forwarding them to the child process. Useful in situations where for     example a supervisor process signals both the bootloader and the child (e.g., via a process group) to avoid signalling     the child twice.

  

  

主要参数设定信息:

# 指定打包输出路径 默认当前路径下的dist目录
# Where to put the bundled app (default: ./dist)--distpath DIR        # 指定打包时的临时文件
# Where to put all the temporary work files, .log, .pyz and etc. (default: ./build)--workpath WORKPATH   # 打包构建之前清除临时文件
# Clean PyInstaller cache and remove temporary files before building.--clean               # 指定打包时的日志输出级别
# Amount of detail in build-time console messages. LEVEL may be one of TRACE, DEBUG, INFO, WARN, DEPRECATION, ERROR, FATAL   
# (default: INFO). Also settable via and overrides the PYI_LOG_LEVEL environment variable.--log-level LEVEL     # 创建包含可执行文件的单文件夹包(默认)
# Create a one-folder bundle containing an executable (default)-D, --onedir         # 创建一个单文件的执行文件。
# Create a one-file bundled executable.
-F, --onefile         # 指定打包后的文件名称
# Name to assign to the bundled app and spec file (default: first script's basename)-n NAME, --name NAME  Name to assign to the bundled app and spec file (default: first script's basename)# 指定文件的icon图标
# FILE.ico: apply the icon to a Windows executable. FILE.exe,ID: extract the icon with ID from an exe. FILE.icns: apply the  
# icon to the .app bundle on Mac OS. If an image file is entered that isn't in the platform format (ico on Windows, icns on  
# Mac), PyInstaller tries to use Pillow to translate the icon into the correct format (if Pillow is installed). Use "NONE"   
# to not apply any icon, thereby making the OS show some default (default: apply PyInstaller's icon). This option can be     
# used multiple times.-i <FILE.ico or FILE.exe,ID or FILE.icns or Image or "NONE">, --icon <FILE.ico or FILE.exe,ID or FILE.icns or Image or "NONE"># 仅窗口化(不要执行终端进程)
# Windows and Mac OS X: do not provide a console window for standard i/o. On Mac OS this also triggers building a Mac OS     
# .app bundle. On Windows this option is automatically set if the first script is a '.pyw' file. This option is ignored on   
# *NIX systems.-w, --windowed, --noconsole

  

打包测试:

代码:

from PyQt6.QtWidgets import QApplication, QWidget
import sys# Press the green button in the gutter to run the script.
if __name__ == '__main__':app = QApplication(sys.argv)window = QWidget()window.setWindowTitle('PyQt6 Example')window.setGeometry(100, 100, 800, 600)window.show()sys.exit(app.exec())

 

执行命令:pyinstaller -F -w main.py -n pyqt-example -i demo.ico

C:\Users\Administrator\PycharmProjects\pythonProject> pyinstaller -F -w main.py -n pyqt-example -i demo.ico
218 INFO: PyInstaller: 6.8.0, contrib hooks: 2024.7
218 INFO: Python: 3.11.9
226 INFO: Platform: Windows-10-10.0.22631-SP0
226 INFO: Python environment: C:\Users\Administrator\PycharmProjects\pythonProject\.venv
227 INFO: wrote C:\Users\Administrator\PycharmProjects\pythonProject\pyqt-example.spec
230 INFO: Module search paths (PYTHONPATH):
['C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Scripts\\pyinstaller.exe','C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python311\\python311.zip','C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python311\\DLLs','C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python311\\Lib','C:\\Users\\Administrator\\AppData\\Local\\Programs\\Python\\Python311','C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv','C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages','C:\\Users\\Administrator\\PycharmProjects\\pythonProject']
389 INFO: checking Analysis
389 INFO: Building Analysis because Analysis-00.toc is non existent
389 INFO: Running Analysis Analysis-00.toc
389 INFO: Target bytecode optimization level: 0
389 INFO: Initializing module dependency graph...
390 INFO: Caching module graph hooks...
404 INFO: Analyzing base_library.zip ...
1392 INFO: Loading module hook 'hook-encodings.py' from 'C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyInstaller\\hooks'...
2787 INFO: Loading module hook 'hook-pickle.py' from 'C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyInstaller\\hooks'...
3736 INFO: Loading module hook 'hook-heapq.py' from 'C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyInstaller\\hooks'...
4042 INFO: Caching module dependency graph...
4131 INFO: Looking for Python shared library...
4145 INFO: Using Python shared library: C:\Users\Administrator\AppData\Local\Programs\Python\Python311\python311.dll
4145 INFO: Analyzing C:\Users\Administrator\PycharmProjects\pythonProject\main.py
4149 INFO: Loading module hook 'hook-PyQt6.py' from 'C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyInstaller\\hooks'...
4236 INFO: Loading module hook 'hook-PyQt6.QtWidgets.py' from 'C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyInstaller\\hooks'...
4368 INFO: Processing module hooks...
4414 INFO: Loading module hook 'hook-PyQt6.QtCore.py' from 'C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyInstaller\\hooks'...
4570 INFO: Loading module hook 'hook-PyQt6.QtGui.py' from 'C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyInstaller\\hooks'...
4918 INFO: Performing binary vs. data reclassification (108 entries)
4951 INFO: Looking for ctypes DLLs
4961 INFO: Analyzing run-time hooks ...
4963 INFO: Including run-time hook 'C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
4965 INFO: Including run-time hook 'C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pyqt6.py'
4968 INFO: Processing pre-find module path hook _pyi_rth_utils from 'C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\pre_find_module_path\\hook-_pyi_rth_utils.py'.
4969 INFO: Loading module hook 'hook-_pyi_rth_utils.py' from 'C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyInstaller\\hooks'...
4972 INFO: Including run-time hook 'C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_pkgutil.py'
4979 INFO: Looking for dynamic libraries
5085 INFO: Extra DLL search directories (AddDllDirectory): ['C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyQt6\\Qt6\\bin']
5085 INFO: Extra DLL search directories (PATH): ['C:\\Users\\Administrator\\PycharmProjects\\pythonProject\\.venv\\Lib\\site-packages\\PyQt6\\Qt6\\bin']
5979 INFO: Warnings written to C:\Users\Administrator\PycharmProjects\pythonProject\build\pyqt-example\warn-pyqt-example.txt
5997 INFO: Graph cross-reference written to C:\Users\Administrator\PycharmProjects\pythonProject\build\pyqt-example\xref-pyqt-example.html
6020 INFO: checking PYZ
6020 INFO: Building PYZ because PYZ-00.toc is non existent
6020 INFO: Building PYZ (ZlibArchive) C:\Users\Administrator\PycharmProjects\pythonProject\build\pyqt-example\PYZ-00.pyz
6258 INFO: Building PYZ (ZlibArchive) C:\Users\Administrator\PycharmProjects\pythonProject\build\pyqt-example\PYZ-00.pyz completed successfully.
6283 INFO: checking PKG
6283 INFO: Building PKG because PKG-00.toc is non existent
6283 INFO: Building PKG (CArchive) pyqt-example.pkg
14096 INFO: Building PKG (CArchive) pyqt-example.pkg completed successfully.
14100 INFO: Bootloader C:\Users\Administrator\PycharmProjects\pythonProject\.venv\Lib\site-packages\PyInstaller\bootloader\Windows-64bit-intel\runw.exe
14100 INFO: checking EXE
14100 INFO: Building EXE because EXE-00.toc is non existent
14100 INFO: Building EXE from EXE-00.toc
14100 INFO: Copying bootloader EXE to C:\Users\Administrator\PycharmProjects\pythonProject\dist\pyqt-example.exe
14111 INFO: Copying icon to EXE
14302 INFO: Copying 0 resources to EXE
14302 INFO: Embedding manifest in EXE
14482 INFO: Appending PKG archive to EXE
14513 INFO: Fixing EXE headers
14694 INFO: Building EXE from EXE-00.toc completed successfully.
(.venv) PS C:\Users\Administrator\PycharmProjects\pythonProject>

 

 

  

 

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.hqwc.cn/news/737093.html

如若内容造成侵权/违法违规/事实不符,请联系编程知识网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

Day1| 704. 二分查找 27. 移除元素

704.二分查找 题目链接 : https://leetcode.cn/problems/binary-search/description/ 思路😗*切记二分查找要基于排序好的数组或者数据,否则二分查找必不能使用!!!!!!!!! ** 双指针写最简单,一个头指针从0开始,一个尾指针从数组长度-1开始,中间指针是头+尾/2,每次比较头尾中间…

不同操作系统下的换行符

1. 关键字 2. 换行符的比较 3. ASCII码 4. 修改换行符4.1. VSCode5. 参考文档1. 关键字 CR LF CRLF 换行符 2. 换行符的比较英文全称 英文缩写 中文含义 转义字符 ASCII码值 操作系统Carriage Return CR 回车 \r 13 MacIntosh(早期的Mac)Linefeed LF 换行/新行 \n 10 Unix/Li…

1s内控制向某个请求请求的次数

背景 有的时候后端提供的接口对相同的IP进行限制,在某个时间内不能发送超过X条的请求,一旦超过指定的请求数会导致后续请求接口会出现异常。 效果需求 比如:在1s内最多同时发送2个请求,多出来的请求在后续的1s或者后续的Ns中发起 代码 <template><div class="…

电脑hold escape key to prevent startlsback怎么处理?

电脑出现hold escape key to prevent StartlsBack from,一般遇到这种问题之后,一直按住ESC键就没有了。但是还需彻底的解决掉这个问题。 首先我们按下“ctrl +alt +del”组合键打开任务管理器,左上角“运行新任务”,输入“control”并确定,就可以打开控制面板,查看方式为…

7.3日RTOS自学心得

我现在用的单片机主要是裸机系统,轮询系统和前后台系统(中断处理),但是为了以后的职业发展肯定还是要学习下操作系统的,也就是多任务系统FreeRTOS,在看野火的资料【[野火]uCOS-III 内核实现与应用开发实战指南】,学习到了第六章,任务的定义与任务切换的实现。 总结如下…

fisher线性判别分析和多分类问题探究

本文继续来讨论另一种分类模型————fisher线性判别分析 目录一、模型思想二、SPSS的实现1.参数设置(1)定义范围(2) 统计(3)保存与分类2.结果分析(1)典则判别函数系数(2)分类结果(3)分类函数系数(4)保存预测结果四、多分类问题 一、模型思想 我们以二分类问题举例…

[Paper Reading] GAIA-1: A Generative World Model for Autonomous Driving

GAIA-1: A Generative World Model for Autonomous Driving GAIA-1 时间:23.09 机构:Wayve TL;DR 本文介绍一种生成世界模型,该模型利用视频、文本和动作输入来生成逼真的驾驶场景,同时提供对自身车辆行为和场景特征的细粒度控制。 Method模型输入 训练过程输入video/text(…

进度报告1

(1)1.在黑马程序员中找到java的教学网课,初步学习了Java语言的概述以及完成了java的开发环境搭建,成功安装了jdk并且利用命令行窗口顺利验证java和javac是否正常安装并且能使用。2.编写入门代码helloworld代码:public class HelloWorld{ public static void main(String[]…

模拟集成电路设计系列博客——8.4.2 时间-数字转换器

8.4.2 时间-数字转换器 在上一节我们介绍了TDC的一种典型实现,即单延时链TDC,通过\(2^N\)的延迟单元和D触发器可以实现N bit的时间数字转换功能,但这种结构的分辨率受到延迟单元的最小延迟时间限制,即: \[LSB=\tau_{delay}=\frac{T}{2^N} \tag{8.4.10} \]其中\(T\)为TDC的…

聊一聊领域驱动与贫血模型

写在前面 前段时间跟领导讨论技术债概念时不可避免地提到了代码的质量,而影响代码质量的因素向来都不是单一的,诸如项目因素、管理因素、技术选型、人员素质等等,因为是技术债务,自然就从技术角度来分析,单纯从技术角度来看代码质量,其实又细分很多原因,如代码设计、代码…

《智能计算系统》第五章 编程框架原理(上)课程笔记

《智能计算系统》第五章 编程框架原理(上)课程视频链接:https://www.bilibili.com/video/BV1Ei421i7Rg 本文源自于B站国科大计算所 智能计算系统课程官方账号 所公开上传的视频,在原有视频之上,提取了关键帧、将音频转成了文字并进行了校正,以便学习使用。在此,也感谢国…

点云分割网络---Point Transformer V2

PDF: 《Point Transformer V2: Grouped Vector Attention and Partition-based Pooling》 CODE: https://github.com/Gofinge/PointTransformerV2 一、大体内容 前面一篇文章介绍了Point Transformer,这一篇在其基础上进行改进,提出了强大且高效的Point Transformer V2模型,…

【坚果识别】果实识别+图像识别系统+Python+计算机课设+人工智能课设+卷积算法

一、介绍 坚果识别系统,使用Python语言进行开发,通过TensorFlow搭建卷积神经网络算法模型,对10种坚果果实(杏仁, 巴西坚果, 腰果, 椰子, 榛子, 夏威夷果, 山核桃, 松子, 开心果, 核桃)等图片数据集进行训练,得到一个识别精度较高的模型文件,让后使用Django搭建Web网页端…

MRCTF 2022 EzJava

MRCTF 2022 EzJava 题目分析 下载附件得到一个 jar 包和一个 waf 配置文件。如果只是为了本地搭建环境,直接启动 jar 包就行了,但是如果需要进行远程调试就需要进行一些配置(这个网上教程很多),这个调试也要看具体需求,能直接打通的话就不需要调试。 但是不管怎么说,第一…

逻辑回归求解二分类问题以及SPSS的实现

分类问题就是给出物质的属性,判断其属于什么成分,本文将讲述逻辑回归求解二分类问题 本文着重于模型的实现,对于推导只是概括性的叙述 目录一、问题提出二、逻辑回归函数logistic1.线性线性概率模型2.sigmod函数3.求解方法————极大似然估计4.分类原则三、SPSS实现———…

线上的一次fullgc排查过程

线上服务的GC问题,是Java程序非常典型的一类问题,非常考验工程师排查问题的能力。同时,几乎是面试必考题,但是能真正答好此题的人并不多,要么原理没吃透,要么缺乏实战经验。过去半年时间里,我们的广告系统出现了多次和GC相关的线上问题,有Full GC过于频繁的,有Young G…

基于GWO灰狼优化的LDPC码NMS译码算法最优归一化参数计算和误码率matlab仿真

1.算法仿真效果 matlab2022a仿真结果如下(完整代码运行后无水印):2.算法涉及理论知识概要LDPC码是一种线性错误修正码,以其接近香农极限的优良性能而被广泛应用于现代通信系统中。NMS译码是一种基于最小平方误差准则的软判决译码方法,其目标是找到一个最可能的码字,使得接…

k8s-核心组件

核心组件组成 Kubernetes 主要由以下几个核心组件组成: - etcd :保存整个集群的状态 - API Server:提供了资源操作的唯一入口,并提供认证、授权、访问控制、API注册和发现等机制 - Controller Manager:负责维护集群的状态,如故障检测、自动扩展、滚动更新等 - Scheduler:…

学习笔记485—Excel技巧:一键将文本数字转换为数值

Excel技巧:一键将文本数字转换为数值在使用Excel进行数据处理时,经常会遇到数据格式不匹配的问题。特别是当从外部导入数据或手动输入数据时,数字可能会被误识别为文本格式,这在进行数据计算和分析时会带来诸多不便。幸运的是,Excel提供了一些便捷的方法,可以帮助我们一键…

使用IDEA给项目打jar包

使用IDEA给项目打jar包参考地址:https://www.cnblogs.com/blog5277/p/5920560.html 感谢作者一、准备一个Java项目并先看看效果 ​ 只想打包,就跳过这一步: 一、准备一个Java项目并先看看效果。 ​ 如果启动jar包遇到报错:无法找到/加载主类就去看看第二步开头。 1、找一…