马士兵Python学习笔记_P145_144.学生信息管理系统-项目打包生成exe可执行文件

马士兵Python学习笔记_P145_144.学生信息管理系统-项目打包生成exe可执行文件

一、项目打包

在这里插入图片描述

二、代码示例:pyinstaller -F .py文件路径

C:\Users\song>pip install PyInstaller -i http://pypi.douban.com/simple --trusted-host pypi.douban.com		# 在线安装 PyInstaller 模块
Looking in indexes: http://pypi.douban.com/simple
Collecting PyInstaller
  Downloading http://pypi.doubanio.com/packages/1a/74/c65be869ae47649b98a928b3122c27d72fe372138aab4dc6cdd42e217d8a/pyinstaller-5.13.2-py3-none-win_amd64.whl (1.3 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 2.5 MB/s eta 0:00:00
Requirement already satisfied: setuptools>=42.0.0 in d:\environment\python\python311\lib\site-packages (from PyInstaller) (65.5.0)
Collecting altgraph
  Downloading http://pypi.doubanio.com/packages/cc/ff/88d277ba936d226b0f6dbd6711145f90fcfeed3aa9455c1c2f62c8ffec5b/altgraph-0.17.3-py2.py3-none-any.whl (21 kB)
Collecting pyinstaller-hooks-contrib>=2021.4
  Downloading http://pypi.doubanio.com/packages/90/6e/642935b6470115eb10339ffd843ee7dbbd7ea2f2ec9bb8cca439c6b3286e/pyinstaller_hooks_contrib-2023.8-py2.py3-none-any.whl (282 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 282.9/282.9 kB 2.9 MB/s eta 0:00:00
Collecting pefile>=2022.5.30
  Downloading http://pypi.doubanio.com/packages/55/26/d0ad8b448476d0a1e8d3ea5622dc77b916db84c6aa3cb1e1c0965af948fc/pefile-2023.2.7-py3-none-any.whl (71 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 71.8/71.8 kB 4.1 MB/s eta 0:00:00
Collecting pywin32-ctypes>=0.2.1
  Downloading http://pypi.doubanio.com/packages/a4/bc/78b2c00cc64c31dbb3be42a0e8600bcebc123ad338c3b714754d668c7c2d/pywin32_ctypes-0.2.2-py3-none-any.whl (30 kB)
Installing collected packages: altgraph, pywin32-ctypes, pyinstaller-hooks-contrib, pefile, PyInstaller
Successfully installed PyInstaller-5.13.2 altgraph-0.17.3 pefile-2023.2.7 pyinstaller-hooks-contrib-2023.8 pywin32-ctypes-0.2.2

[notice] A new release of pip available: 22.3.1 -> 23.2.1
[notice] To update, run: python.exe -m pip install --upgrade pip

C:\Users\song>pip list		# 查看安装了哪些python第三方包
Package                   Version
------------------------- ---------
altgraph                  0.17.3
certifi                   2022.12.7
charset-normalizer        3.1.0
ffmpeg-python             0.2.0
future                    0.18.3
idna                      3.4
lxml                      4.9.2
pefile                    2023.2.7
pip                       22.3.1
pyinstaller               5.13.2
pyinstaller-hooks-contrib 2023.8
pywin32-ctypes            0.2.2
requests                  2.28.2
schedule                  1.2.0
selenium                  2.53.6
setuptools                65.5.0
urllib3                   1.26.15

[notice] A new release of pip available: 22.3.1 -> 23.2.1
[notice] To update, run: python.exe -m pip install --upgrade pip

C:\Users\song>pip show PyInstaller		# 查看 PyInstaller 包信息
Name: pyinstaller
Version: 5.13.2
Summary: PyInstaller bundles a Python application and all its dependencies into a single package.
Home-page: https://www.pyinstaller.org/
Author: Hartmut Goebel, Giovanni Bajo, David Vierra, David Cortesi, Martin Zibricky
Author-email:
License: GPLv2-or-later with a special exception which allows to use PyInstaller to build and distribute non-free programs (including commercial ones)
Location: D:\Environment\Python\Python311\Lib\site-packages
Requires: altgraph, pefile, pyinstaller-hooks-contrib, pywin32-ctypes, setuptools
Required-by:

C:\Users\song>pyinstaller -F D:\Environment\PythonWorks\learnpython\马士兵Python\第16章_学生信息管理系统\stusystem.py		# 打包成 exe 可执行文件
822 INFO: PyInstaller: 5.13.2
822 INFO: Python: 3.11.2
833 INFO: Platform: Windows-10-10.0.22621-SP0
834 INFO: wrote C:\Users\song\stusystem.spec
835 INFO: Extending PYTHONPATH with paths
['D:\\Environment\\PythonWorks\\learnpython']
995 INFO: checking Analysis
996 INFO: Building Analysis because Analysis-00.toc is non existent
996 INFO: Initializing module dependency graph...
1002 INFO: Caching module graph hooks...
1013 INFO: Analyzing base_library.zip ...
2151 INFO: Loading module hook 'hook-heapq.py' from 'D:\\Environment\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\hooks'...
2264 INFO: Loading module hook 'hook-encodings.py' from 'D:\\Environment\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\hooks'...
3657 INFO: Loading module hook 'hook-pickle.py' from 'D:\\Environment\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\hooks'...
5636 INFO: Caching module dependency graph...
5721 INFO: running Analysis Analysis-00.toc
5730 INFO: Adding Microsoft.Windows.Common-Controls to dependent assemblies of final executable
  required by D:\Environment\Python\Python311\python.exe
5801 INFO: Analyzing D:\Environment\PythonWorks\learnpython\马士兵Python\第16章_学生信息管理系统\stusystem.py
5807 INFO: Processing module hooks...
5814 INFO: Looking for ctypes DLLs
5821 INFO: Analyzing run-time hooks ...
5822 INFO: Including run-time hook 'D:\\Environment\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\hooks\\rthooks\\pyi_rth_inspect.py'
5825 INFO: Looking for dynamic libraries
214 INFO: Extra DLL search directories (AddDllDirectory): []
214 INFO: Extra DLL search directories (PATH): ['C:\\Windows\\system32', 'C:\\Windows', 'C:\\Windows\\System32\\Wbem', 'C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\', 'C:\\Windows\\System32\\OpenSSH\\', 'C:\\Program Files\\dotnet\\', 'D:\\Environment\\Go\\bin', 'D:\\Environment\\ffmpeg-2023-03-20-git-57afccc0ef-essentials_build\\bin', 'D:\\Environment\\MySQL\\MySQL Server 8.0.26\\bin', 'D:\\Environment\\Python\\Python311\\Scripts\\', 'D:\\Environment\\Python\\Python311\\', 'C:\\Users\\song\\AppData\\Local\\Microsoft\\WindowsApps', 'C:\\Users\\song\\go\\bin']
6354 INFO: Looking for eggs
6354 INFO: Using Python library D:\Environment\Python\Python311\python311.dll
6354 INFO: Found binding redirects:
[]
6356 INFO: Warnings written to C:\Users\song\build\stusystem\warn-stusystem.txt
6367 INFO: Graph cross-reference written to C:\Users\song\build\stusystem\xref-stusystem.html
6378 INFO: checking PYZ
6378 INFO: Building PYZ because PYZ-00.toc is non existent
6379 INFO: Building PYZ (ZlibArchive) C:\Users\song\build\stusystem\PYZ-00.pyz
6572 INFO: Building PYZ (ZlibArchive) C:\Users\song\build\stusystem\PYZ-00.pyz completed successfully.
6577 INFO: checking PKG
6577 INFO: Building PKG because PKG-00.toc is non existent
6577 INFO: Building PKG (CArchive) stusystem.pkg
8025 INFO: Building PKG (CArchive) stusystem.pkg completed successfully.
8027 INFO: Bootloader D:\Environment\Python\Python311\Lib\site-packages\PyInstaller\bootloader\Windows-64bit-intel\run.exe
8027 INFO: checking EXE
8027 INFO: Building EXE because EXE-00.toc is non existent
8027 INFO: Building EXE from EXE-00.toc
8027 INFO: Copying bootloader EXE to C:\Users\song\dist\stusystem.exe.notanexecutable
8031 INFO: Copying icon to EXE
8032 INFO: Copying icons from ['D:\\Environment\\Python\\Python311\\Lib\\site-packages\\PyInstaller\\bootloader\\images\\icon-console.ico']
8032 INFO: Writing RT_GROUP_ICON 0 resource with 104 bytes
8032 INFO: Writing RT_ICON 1 resource with 3752 bytes
8032 INFO: Writing RT_ICON 2 resource with 2216 bytes
8032 INFO: Writing RT_ICON 3 resource with 1384 bytes
8032 INFO: Writing RT_ICON 4 resource with 37019 bytes
8032 INFO: Writing RT_ICON 5 resource with 9640 bytes
8032 INFO: Writing RT_ICON 6 resource with 4264 bytes
8032 INFO: Writing RT_ICON 7 resource with 1128 bytes
8033 INFO: Copying 0 resources to EXE
8034 INFO: Embedding manifest in EXE
8034 INFO: Updating manifest in C:\Users\song\dist\stusystem.exe.notanexecutable	# 		# 生成的 exe 可执行文件的路径:C:\Users\song\dist\stusystem.exe
8034 INFO: Updating resource type 24 name 1 language 0
8036 INFO: Appending PKG archive to EXE
8039 INFO: Fixing EXE headers
8089 INFO: Building EXE from EXE-00.toc completed successfully.

C:\Users\song>

运行结果

在这里插入图片描述
在这里插入图片描述
B站视频链接:https://www.bilibili.com/video/BV1wD4y1o7AS?p=145

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
图像反转 f=imread('breast.tif'); imshow(f) f1=imadjust(f,[0 1],[1 0]); figure,imshow(f1) 对数运算 f=imread('12.tif'); imshow(f) F=fft2(f); s=abs(F); h=log(1+s); FC=fftshift(h); figure,imshow(FC,[]) 直方图均衡化 f=imread('pollen.tif'); imshow(f) h=imhist(f); figure,stem(h,'.') g=histeq(f,256); figure,imshow(g) figure,imhist(g) 低通滤波(课本P96) f=imread('bld.tif'); imshow(f); f1=fftshift(f); g=abs(f1); imshow(g,[]); f=imread('bld.tif'); f=im2double(f); imshow(f); v=[1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9,1/9]; g1=imfilter(f,v); figure,imshow(g1); f=imread('bld.tif'); imshow(f); f1=fftshift(f); g=abs(f1); imshow(g,[]); f=imread('bld.tif'); f=im2double(f); imshow(f); h = fspecial('average',[9 9]); g1=imfilter(f,h); figure,imshow(g1) h = fspecial('average',[15 15]); g2=imfilter(f,h); figure,imshow(g2) 拉普拉斯滤波(课本P102) f=imread('moon.tif'); imshow(f); f1=fftshift(f); g=abs(f1); imshow(g,[]); f=imread('moon.tif'); f=im2double(f); imshow(f); h = fspecial('laplacian',0); g1=imfilter(f,h); figure,imshow(g1) 显示目的标定后的图像 f=imread('moon.tif'); imshow(f); f=im2double(f); imshow(f); h = [0,1,0;1,-4,1;0,1,0]; g1=imfilter(f,h); figure,imshow(g1,[]) 拉普拉斯增强 f=imread('moon.tif'); imshow(f) f=im2double(f); imshow(f); h = [0,-1,0;-1,5,-1;0,-1,0]; g1=imfilter(f,h); figure,imshow(g1) 理想低通(课本P145) f=imread('bld.tif'); imshow(f) [M,N]=size(f); F=fft2(f); H=lpfilter('ideal',M,N,50); G=H.*F; g=real(ifft2(G)); figure,imshow(g,[]) 高通 f=imread('bld.tif'); imshow(f) [M,N]=size(f); F=fft2(f); H=1-lpfilter('ideal',M,N,50); G=H.*F; g=real(ifft2(G)); figure,imshow(g,[]) 空间域转换成频域 f=imread('bld.tif'); f=im2double(f); imshow(f); h = [-1,-1,-1;-1,9,-1;-1,-1,-1]; H=freqz2(h,100,100); H1=ifftshift(H); figure,mesh(abs(H1)); a=max(max(H1)); b=min(min(H1)) 将花心填充呈黄色 f=imread('rgbr.tif'); imshow(f) [M,N]=size(f); for i=1:1:M for j=1:1:N if f(i,j)>=220 fb(i,j)=0; else if f(i,j)>=198&f(i,j)<220 fb(i,j)=50; else if f(i,j)<=198 fb(i,j)=f(i,j); end end end end end fb=im2uint8(fb); f2=cat(3,f,f,fb); figure,imshow(fb); figure,imshow(f2) 将月球边缘填充成黄色 (1)f=imread('moon.tif'); imshow(f) [M,N]=size(f); for i=1:1:M for j=1:1:N fb(i,j)=f(i,j); fr(i,j)=0; fg(i,j)=0; end end f2=cat(3,fr,fg,fb); figure,imshow(f2); w=[0 -1 0;-1 5 -1;0 -1 0]; g=imfilter(f2,w); figure,imshow(g) [M,N]=size(g); for i=1:1:M for j=1:1:N if g(i,j)<=100 gr(i,j)=g(i,j); gg(i,j)=g(i,j); gb(i,j)=g(i,j); else if 100<g(i,j)<=198 gr(i,j)=g(i,j); gg(i,j)=255-g(i,j); gb(i,j)=g(i,j); else if 100<g(i,j)<=255 gr(i,j)=255-g(i,j); gg(i,j)=g(i,j); gb(i,j)=g(i,j); end end end end end v=cat(3,gr,gg,gb); figure,imshow(v) (2)可先将原图像增强,然后将增强后图像的红色分量、绿色分量与原图像的蓝色分量叠加即可 f=imread('moon.tif'); imshow(f) w=[0 -1 0;-1 5 -1;0 -1 0]; fo=imfilter(f,w); g=cat(3,for,fog,fb); figure,imshow(g) 频域上实现同态滤波 f=imread('ttlb2.tif'); imshow(f) [M N]=size(f); Hbtw=hpfilter('btw',2*M,2*N,40); Ht=2*Hbtw+0.2; f=im2double(f); idx=find(f==0); f(idx)=eps; Inf=log(f); F=fft2(Inf,2*M,2*N); hf=real(ifft2(Ht.*F)); gf=exp(hf); gf=gf(1:size(f,1),1:size(f,2)); figure,imshow(gf) 空间域上实现同态滤波 f=imread('ttlb2.tif'); imshow(f) [M N]=size(f); f=im2double(f); idx=find(f==0); f(idx)=eps; Inf=log(f); F=fft2(Inf,2*M,2*N); w=[0 -1 0,-1 4.5 -1,0 -1 0]; h=real(ifft2(F)); hf=imfilter(h,w); gf=exp(hf); gf=gf(1:size(f,1),1:size(f,2)); figure,imshow(gf) 膨胀 f=imread('shapes.tif'); imshow(f) w=[0 0 0 0 1,0 0 0 1 0,0 0 1 0 0,0 1 0 0 0,1 0 0 0 0]; f2=imdilate(f,w); figure,imshow(f2) 开运算、闭运算 f=imread('fingerprint.tif'); imshow(f) se=strel('square',3); f1=imopen(f,se); figure,imshow(f1) f2=imclose(f1,se); figure,imshow(f2) 击中击不中 f=imread('text2.tif'); imshow(f) B1=[0 0 0,0 1 1,0 1 1]; B2=[1 1 1,1 0 0,1 0 0]; f2=bwhitmiss(f,B1,B2); figure,imshow(f2) 重构 f=imread('text2.tif'); imshow(f) fe=imerode(f,ones(15,1)); figure,imshow(fe) foc=imreconstruct(fe,f); figure,imshow(foc) 腐蚀 f=imread('wirebond.tif'); imshow(f) se=strel('disk',10); f2=imerode(f,se); figure,imshow(f2) se=strel('disk',5); f3=imerode(f,se); figure,imshow(f3) se=strel('disk',20); f4=imerode(f,se); figure,imshow(f4)
第7章 数据库设计重、难点 7.1 概述 7.1.1 数据库设计的任务 数据库的生命周期:一是数据库的设计阶段,二是数据库的实施和运行阶段。 数据库设计的基本任务:根据一个单位的信息需求、处理需求和数据库的支撑环境(包 括DBMS、操作系统和硬件),设计出数据模式(包括外模式、逻辑(概念)模式和内模 式)以及典型的应用程序。 数据库设计的两种不同的方法:一种是以信息需求为主,兼顾外理需求,这种称为面向 数据的设计方法;另一种是以处理需求主主,兼顾信息需求,这种方法称为面向过程的 设计方法。 数据库设计的成果:一是数据模式,二是以数据库为基础的典型应用程序。 7.1.2 数据库设计的特点 1) 反复性 2) 试探性 3) 分步进行 7.1.3 数据库设计的步骤(P143图7.1) 1、 需求分析 2、 概念设计 3、 逻辑设计 4、 物理设计 7.2 需求分析 设计一个数据库,首先必须确认数据库的用户和用途。由于数据库是一个单位的模拟, 数据库设计者必须对一个单位的组织机构、各部门的联系、有关事物和活动以及描友谊 赛它们的数据、信息流程、政策和制度、报表及其格式和有关的文档等有所了解。收集 和分析这些资料的过程称为需求分析。 元数据 数据字典(P145) 7.2.1 应用领域的调查 两个阶段:第一阶段,对应用领域的组织结构、业务流程和数据流程进行调查,对现行 系统的功能和所需信息有一个明确的认识;第二阶估,在第一阶段的基础上进行应用领 域的分析,抽象出应用领域的逻辑模型,最后把逻辑模型用数据流图来表示。 7.2.2 定义信息与应用(P147) 定义数据库系统支持的信息的目的及步骤 定义数据库系统支持的应用的目的及步骤 7.2.3 定义操作任务(DBIPO图) 一个应用包括一个或多个数据库操作任务。每个数据库操作任务可属于多个应用。 划分数据库操作任务的规则如下:1,2,3,4(P148) 7.2.4 定义数据项(DD) 7.2.5 预测未来的改变 7.3 概念设计 概念设计的任务包括数据库概念模式设计和事务设计两个方面。其中事务设计的任务 是,考察需求分析阶段提出的数据库操作任务,形成数据库事务的高级说明。数据库概 念模式设计的任务是,以需求分析阶段所识别的数据项和应用领域的求来改变信息为基 础,使用高级数据库模型建立数据库概念模式。 7.3.1 概念设计的基本方法 1、 集中式模式设计法 2、 视图综合设计法 7.3.2 视图设计的基本策略 1、 自顶向下 2、 自底向上 3、 由内向外 7.3.3 视图综合设计方法 1、 局部概念模式设计 2、 视图的集成 7.4 逻辑设计(定义解释p165) 7.4.1 E/R图到关系模式的转换 1、 实体集的转换 2、 联系的转换 1) 1:1联系 2) 1:N联系 3) M:N联系 7.4.2 逻辑模式的规范化和优化 7.5 物理设计 (P160) 数据库物理设计的任务是在数据库逻辑设计的基础上,为每个关系模式选择合适的存取 方法和存储结构。最常用的存取方法是索引方法。在常用的连接属性和选择属性上建立 索引,可显著提高查询效率。 7.5.1 影响物理设计的因素 7.5.2 选择存取方法 7.5.3 设计存储结构 1) 减少访盘冲突,提高I/O的并行性 2) 分散热点数据,均衡I/O负荷 3) 保证关键数据的快速访问,缓解系统的瓶颈 7.6 数据库的实施、运行和维护 7.6.1 数据库的实施 1、 建立实际数据库的结构 2、 装入试验数据,调试应用程序 3、 装入实际数据 4、 进入试运行 7.6.2 数据库的运行和维护 1、 数据库的转储和恢复 2、 维持数据库的安全性与完整性 3、 监测并改善数据库性能 4、 数据库的重组和重构 ----------------------- 数据库设计重、难点全文共5页,当前为第1页。 数据库设计重、难点全文共5页,当前为第2页。 数据库设计重、难点全文共5页,当前为第3页。 数据库设计重、难点全文共5页,当前为第4页。 数据库设计重、难点全文共5页,当前为第5页。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值