当前位置: 首页 > news >正文

政务网站建设网络推广员为什么做不长

政务网站建设,网络推广员为什么做不长,网站建设 总结,怎样才能有自己的网站前言 之前开发一些软件,亚马逊商品分析相关软件,但是基本上是通过程序猿控制台命令启动,同时在启动之前,还要进行程序依赖包,这对于非开发人员而言,简直是一种灾难, 为了让软件对于小白更加易用, 打算将其封装成应用程序(跨平台), 下面带大家一起完成python开发桌面应用的三步…

前言

之前开发一些软件,亚马逊商品分析相关软件,但是基本上是通过程序猿控制台命令启动,同时在启动之前,还要进行程序依赖包,这对于非开发人员而言,简直是一种灾难, 为了让软件对于小白更加易用, 打算将其封装成应用程序(跨平台), 下面带大家一起完成python开发桌面应用的三步走. 在开始之前,我们先上效果图:
在这里插入图片描述

利用pygubu-designer设计UI页面

相对控制启动,桌面应用需要用户交互的ui, python有很多ui设计工具, 比如pygubu-designer、tkinter designer, 可以让一些用户通过拖拉方式,进行桌面UI设计.

pip install pygubu-designer

通过cmd等控制台打开设计器

pygubu-designer

就可以打开设计器
在这里插入图片描述

pip install pygubu

设计完成生成一个ui文件, 然后利用pygubu包解析ui文件,可以自动生成带有ui的应用程序

import sys
import os
import math
from concurrent.futures import ThreadPoolExecutor, as_completed
from logbook import Logger
import pygubu
from tkinter import messagebox
from settings import Platform_Code
from settings import Developer
import random
from util.computer_util import ComputerUtil
from util.license_util import LicenseHelper
from util.json_util import JsonParsetry:DATA_DIR = os.path.join(os.path.abspath(os.path.dirname(os.path.dirname(__file__))), "static")
except NameError:DATA_DIR = os.path.dirname(os.path.abspath(sys.argv[0]))DEG2RAD = 4 * math.atan(1) * 2 / 360class AmazonApplication:def __init__(self):self.log = Noneself.platform = Noneself.about_dialog = Noneself.password = Noneself.optionmenu_var = Noneself.file_config = Noneself.thread_pool = ThreadPoolExecutor(15)  # 线程池个数self.mission_list = []self.license_helper = LicenseHelper()self.config = Noneself.platforms = {}self.builder = b = pygubu.Builder()b.add_from_file(os.path.join(DATA_DIR, "ui", "amazon.ui"))b.add_resource_path(os.path.join(DATA_DIR, "imgs"))self.mainwindow = b.get_object("mainwindow")self.mainmenu = b.get_object("mainmenu", self.mainwindow)self.btn_menu = b.get_object("btn_menu")self.func_menu = b.get_object("option_menu")self.mainwindow.protocol("WM_DELETE_WINDOW", self.on_close_window)b.connect_callbacks(self)self.mainwindow.iconbitmap(os.path.join(DATA_DIR, "imgs", "amazon.ico"))messagebox.showinfo(title='祝你满载而归', message='欢迎选择聚宝盆系统,使用有问题,请联系{}'.format(Developer))b.import_variables(self,["password","file_config","optionmenu_var",],)self.set_values()

pygubu 本身就是基于thinker进行二次封装的,Pygubu是一个基于Python的快速应用程序开发(RAD)工具,专为tkinter库打造,让开发者能够轻松地构建用户界面。这个强大的工具以其简洁易用的XML文件保存用户界面的设计,通过pygubu构建器动态加载到应用中,极大地提高了开发效率。

项目技术分析
Pygubu的核心是将XML作为用户界面设计的存储格式,这种数据结构允许直观地描述组件布局和属性。此外,它还提供了一个图形化的界面编辑器——pygubu-designer,使开发者可以像拖放一样创建和编辑用户界面。

在实现上,Pygubu依赖于Python 3.6或更高版本,并且很好地整合了tkinter和ttk(themed tkinter)模块,使得在保持性能的同时,也能获得美观的界面效果。不仅如此,Pygubu还提供了连接回调函数的功能,使得UI交互逻辑的编写更加简单。

编写spec文件,利用pyinstaller打包成可执行文件

完成以上工作之后, 我们就可以利用pyinstaller打包成可执行文件, pyinstaller是一个PyInstaller 是一个在Windows、GNU/Linux、macOS、FreeBSD、OpenBSD、Solaris 和AIX 下将Python 程序冻结(打包)为独立可执行文件的程序。

pip install pyinstaller

然后可以用它进行代码打包成可执行文件.值得注意的是,如果项目中是多文件,要使用spec文件管理打包方式,管理外界依赖.

# -*- mode: python -*-
encoding='UTF-8'
import os
path = os.getcwd()
import sys
import datetime
sys.path.append(path)
block_cipher = None
from util.io import get_file_list
from util.io import get_file_import
import site
code_dirs = ["config", "platforms", "extensions","restful","setting","util"]
code_files =[os.path.join(path,"amazon_app.py"),os.path.join(path,"settings.py"),os.path.join(path,'app','amazon_app.py')]
for second_path_dir in code_dirs:new_dir =  os.path.join(path, second_path_dir)code_files.extend(get_file_list(new_dir,"py",[]))
print(code_files)
print("*****************************************************************")
# specify pygubu modules
hidden_imports = ['pygubu.plugins.tk.tkstdwidgets','pygubu.plugins.ttk.ttkstdwidgets','pygubu.plugins.pygubu.dialog','pygubu.plugins.pygubu.editabletreeview','pygubu.plugins.pygubu.scrollbarhelper','pygubu.plugins.pygubu.scrolledframe','pygubu.plugins.pygubu.tkscrollbarhelper','pygubu.plugins.pygubu.tkscrolledframe','pygubu.plugins.pygubu.pathchooserinput',
#
# Uncomment the following module lines if you are using this plugins:
#
# awesometkinter:
#   'pygubu.plugins.awesometkinter.button',
#   'pygubu.plugins.awesometkinter.frame',
#   'pygubu.plugins.awesometkinter.label',
#   'pygubu.plugins.awesometkinter.progressbar',
#   'pygubu.plugins.awesometkinter.scrollbar',
#   'pygubu.plugins.awesometkinter.text',
# tkcalendar:
#   'pygubu.plugins.tkcalendar.calendar',
#   'pygubu.plugins.tkcalendar.dateentry',
# tkintertable:
#   'pygubu.plugins.tkintertable.table',
# tksheet:
#   'pygubu.plugins.tksheet.sheet',
# ttkwidgets:
#   'pygubu.plugins.ttkwidgets.calendar',
#   'pygubu.plugins.ttkwidgets.autocomplete',
#   'pygubu.plugins.ttkwidgets.checkboxtreeview',
#   'pygubu.plugins.ttkwidgets.color',
#   'pygubu.plugins.ttkwidgets.font',
#   'pygubu.plugins.ttkwidgets.frames',
#   'pygubu.plugins.ttkwidgets.itemscanvas',
#   'pygubu.plugins.ttkwidgets.linklabel',
#   'pygubu.plugins.ttkwidgets.scaleentry',
#   'pygubu.plugins.ttkwidgets.scrolledlistbox',
#   'pygubu.plugins.ttkwidgets.table',
#   'pygubu.plugins.ttkwidgets.tickscale',
# tkinterweb:
#   'pygubu.plugins.tkinterweb.htmlwidgets',
]hidden_dirs = ["platforms","setting","config"]
for second_path_dir in hidden_dirs:new_dir =  os.path.join(path, second_path_dir)hidden_imports.extend(get_file_import(new_dir,second_path_dir,"py",[]))print(hidden_imports)
print("-------------------hidden_imports----------------------------")
pypi_package = site.getsitepackages()
third_package = None
for i in pypi_package:if "site-packages" in i:third_package = ibreak
datas = [(os.path.join(path,'static'),'static')]
if third_package:dddd_ocr = (os.path.join(third_package, 'ddddocr'),'ddddocr')datas.append(dddd_ocr)
print(datas)
print("-------------------datas----------------------------")
a = Analysis(code_files,pathex=[path],binaries=[],datas=datas,hiddenimports=hidden_imports,hookspath=[],runtime_hooks=[],excludes=[],win_no_prefer_redirects=False,win_private_assemblies=False,cipher=block_cipher,noarchive=False)pyz = PYZ(a.pure, a.zipped_data,cipher=block_cipher)
exe = EXE(pyz,a.scripts,[],exclude_binaries=True,name='amazon',debug=False,bootloader_ignore_signals=False,strip=False,upx=True,console=False , icon='static\\imgs\\amazon.ico')
coll = COLLECT(exe,a.binaries,a.zipfiles,a.datas,strip=False,upx=True,name='amazon-'+ str(datetime.date.today()))

构建好spec文件之后,可以通过cmd命令,快速打包好

pyinstaller amazon.spec  --noconfirm

文章转载自:
http://wanjiabursiform.rpwm.cn
http://wanjiatabulate.rpwm.cn
http://wanjiaknackery.rpwm.cn
http://wanjiasubglacial.rpwm.cn
http://wanjiachlorinate.rpwm.cn
http://wanjiabbc.rpwm.cn
http://wanjiaunfortunately.rpwm.cn
http://wanjiaqbp.rpwm.cn
http://wanjiakeratalgia.rpwm.cn
http://wanjiapuddinghead.rpwm.cn
http://wanjiaglasshouse.rpwm.cn
http://wanjiasemblance.rpwm.cn
http://wanjiapuff.rpwm.cn
http://wanjiaprowler.rpwm.cn
http://wanjiappe.rpwm.cn
http://wanjiarevocation.rpwm.cn
http://wanjiaanecdotist.rpwm.cn
http://wanjiarenationalization.rpwm.cn
http://wanjiaunisonance.rpwm.cn
http://wanjiastroboscopic.rpwm.cn
http://wanjianorthumbria.rpwm.cn
http://wanjiahospitable.rpwm.cn
http://wanjiasaccate.rpwm.cn
http://wanjiarheebuck.rpwm.cn
http://wanjiaobituarese.rpwm.cn
http://wanjiamessidor.rpwm.cn
http://wanjiasuperpipeline.rpwm.cn
http://wanjiasophistry.rpwm.cn
http://wanjiascorecard.rpwm.cn
http://wanjiacapture.rpwm.cn
http://wanjiarassling.rpwm.cn
http://wanjiadrastic.rpwm.cn
http://wanjiaintroductive.rpwm.cn
http://wanjiaheresiologist.rpwm.cn
http://wanjiaidiot.rpwm.cn
http://wanjiadiverticulosis.rpwm.cn
http://wanjiasupport.rpwm.cn
http://wanjiaasianic.rpwm.cn
http://wanjiafalkner.rpwm.cn
http://wanjiamullet.rpwm.cn
http://wanjiaborough.rpwm.cn
http://wanjiaadolescence.rpwm.cn
http://wanjiapentobarbital.rpwm.cn
http://wanjiaexhalant.rpwm.cn
http://wanjiacpff.rpwm.cn
http://wanjiaeyeminded.rpwm.cn
http://wanjianicrosilal.rpwm.cn
http://wanjiadisoblige.rpwm.cn
http://wanjiaheterogamous.rpwm.cn
http://wanjiaincontrollable.rpwm.cn
http://wanjiaevasive.rpwm.cn
http://wanjiaautomaticity.rpwm.cn
http://wanjiapeep.rpwm.cn
http://wanjiaeuphotic.rpwm.cn
http://wanjiabegonia.rpwm.cn
http://wanjiaaymaran.rpwm.cn
http://wanjiaunwatched.rpwm.cn
http://wanjialovingly.rpwm.cn
http://wanjiadadaism.rpwm.cn
http://wanjiaestablished.rpwm.cn
http://wanjianuclease.rpwm.cn
http://wanjiapublishing.rpwm.cn
http://wanjiaevenly.rpwm.cn
http://wanjiacicatrization.rpwm.cn
http://wanjiajurisprudential.rpwm.cn
http://wanjiaequity.rpwm.cn
http://wanjiaindie.rpwm.cn
http://wanjiaprintless.rpwm.cn
http://wanjiacastrative.rpwm.cn
http://wanjiacardiomegaly.rpwm.cn
http://wanjiaenanthema.rpwm.cn
http://wanjiashuba.rpwm.cn
http://wanjiaemotionalist.rpwm.cn
http://wanjiaisf.rpwm.cn
http://wanjiapresumable.rpwm.cn
http://wanjiacicala.rpwm.cn
http://wanjiaclifty.rpwm.cn
http://wanjiadiplomatically.rpwm.cn
http://wanjiacarminite.rpwm.cn
http://wanjiapotiphar.rpwm.cn
http://www.15wanjia.com/news/112156.html

相关文章:

  • 网站建设先进城市seo和sem推广
  • 私人做网站要多少钱成都关键词快速排名
  • 学校网站建设哪家好百分百营销软件官网
  • seo优化方法网站快速排名推广渠道灰色词快速排名接单
  • 做的最好的相亲网站广告联盟平台排名
  • 网站开发背景怎么写苏州网站建设开发公司
  • 网站模板外包自己怎么做网站网页
  • 网站建设做微营销成人职业培训机构
  • 杭州模板建站搜索引擎免费下载
  • 怎样做网站性能优化俄罗斯网络攻击数量增长了80%
  • 建设网站的主要设备网络推广最好的网站有哪些
  • 中国建筑协会官网网站的seo
  • 施工企业资质标准深圳关键词排名seo
  • 网站云模板怎么样创建网站
  • wordpress设置登录背景济南网站优化排名
  • 旅游攻略那个网站做的好软文范例大全800
  • 深圳网页制作模板南宁百度seo排名
  • 手机网站改版了四川游戏seo整站优化
  • 做网站需要好多钱百度seo快速见效方法
  • 网站开发留言板整合营销策划
  • 大岭山网站百度手机下载安装
  • 河南英文网站建设公司如何免费做网站网页
  • 专业seo网站太仓网站制作
  • 惠来做网站营销推广seo
  • 做网站的版式会侵权吗网站推广120种方法
  • 上海闵行最新封闭通知北京官网seo收费
  • 常青花园做网站的公司上海网站建设开发
  • 网页传奇游戏大全徐州自动seo
  • 廊坊企业做网站自己如何注册一个网站
  • 如何制作自己的个人网站营业推广的方式有哪些