中文亚洲精品无码_熟女乱子伦免费_人人超碰人人爱国产_亚洲熟妇女综合网

當前位置: 首頁 > news >正文

長春 網(wǎng)站建設搜索引擎優(yōu)化的分類

長春 網(wǎng)站建設,搜索引擎優(yōu)化的分類,怎樣優(yōu)化網(wǎng)站關(guān)鍵詞,做視頻網(wǎng)站 服務器前言 之前開發(fā)一些軟件,亞馬遜商品分析相關(guān)軟件,但是基本上是通過程序猿控制臺命令啟動,同時在啟動之前,還要進行程序依賴包,這對于非開發(fā)人員而言,簡直是一種災難, 為了讓軟件對于小白更加易用, 打算將其封裝成應用程序(跨平臺), 下面帶大家一起完成python開發(fā)桌面應用的三步…

前言

之前開發(fā)一些軟件,亞馬遜商品分析相關(guān)軟件,但是基本上是通過程序猿控制臺命令啟動,同時在啟動之前,還要進行程序依賴包,這對于非開發(fā)人員而言,簡直是一種災難, 為了讓軟件對于小白更加易用, 打算將其封裝成應用程序(跨平臺), 下面帶大家一起完成python開發(fā)桌面應用的三步走. 在開始之前,我們先上效果圖:
在這里插入圖片描述

利用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)  # 線程池個數(shù)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='歡迎選擇聚寶盆系統(tǒng),使用有問題,請聯(lián)系{}'.format(Developer))b.import_variables(self,["password","file_config","optionmenu_var",],)self.set_values()

pygubu 本身就是基于thinker進行二次封裝的,Pygubu是一個基于Python的快速應用程序開發(fā)(RAD)工具,專為tkinter庫打造,讓開發(fā)者能夠輕松地構(gòu)建用戶界面。這個強大的工具以其簡潔易用的XML文件保存用戶界面的設計,通過pygubu構(gòu)建器動態(tài)加載到應用中,極大地提高了開發(fā)效率。

項目技術(shù)分析
Pygubu的核心是將XML作為用戶界面設計的存儲格式,這種數(shù)據(jù)結(jié)構(gòu)允許直觀地描述組件布局和屬性。此外,它還提供了一個圖形化的界面編輯器——pygubu-designer,使開發(fā)者可以像拖放一樣創(chuàng)建和編輯用戶界面。

在實現(xiàn)上,Pygubu依賴于Python 3.6或更高版本,并且很好地整合了tkinter和ttk(themed tkinter)模塊,使得在保持性能的同時,也能獲得美觀的界面效果。不僅如此,Pygubu還提供了連接回調(diào)函數(shù)的功能,使得UI交互邏輯的編寫更加簡單。

編寫spec文件,利用pyinstaller打包成可執(zhí)行文件

完成以上工作之后, 我們就可以利用pyinstaller打包成可執(zhí)行文件, pyinstaller是一個PyInstaller 是一個在Windows、GNU/Linux、macOS、FreeBSD、OpenBSD、Solaris 和AIX 下將Python 程序凍結(jié)(打包)為獨立可執(zhí)行文件的程序。

pip install pyinstaller

然后可以用它進行代碼打包成可執(zhí)行文件.值得注意的是,如果項目中是多文件,要使用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()))

構(gòu)建好spec文件之后,可以通過cmd命令,快速打包好

pyinstaller amazon.spec  --noconfirm
http://www.risenshineclean.com/news/27686.html

相關(guān)文章:

  • 學網(wǎng)站制作收錄批量查詢工具
  • 2017年政府網(wǎng)站建設蘇州關(guān)鍵詞優(yōu)化搜索排名
  • 廈門網(wǎng)站制作費用明細seo優(yōu)化推廣軟件
  • 做企業(yè)網(wǎng)站需要什么文件廣州疫情最新動態(tài)
  • 沈陽做網(wǎng)站哪家便宜網(wǎng)站搭建需要什么
  • 有自建服務器做網(wǎng)站的嗎體驗營銷案例
  • 這樣做微信網(wǎng)站百度代理授權(quán)查詢
  • 做設計比較好的網(wǎng)站網(wǎng)站推廣排名服務
  • 網(wǎng)站設計要求 優(yōu)幫云營銷推廣方案包括哪些內(nèi)容
  • 江門網(wǎng)站制作維護app下載推廣平臺
  • 企業(yè)建設網(wǎng)站的空間有哪些搜狗收錄提交入口
  • 網(wǎng)站群信息管理系統(tǒng)北京網(wǎng)站優(yōu)化專家
  • 主題公園wordpressseo線下培訓課程
  • 學計算機網(wǎng)站建設seo排名優(yōu)化培訓怎樣
  • 西寧網(wǎng)站seo外包百度安裝到桌面
  • 網(wǎng)站開發(fā)可以做什么seo 優(yōu)化公司
  • 創(chuàng)建小型網(wǎng)站的步驟太原網(wǎng)站關(guān)鍵詞推廣
  • 南通高端網(wǎng)站建設公司關(guān)鍵詞搜索技巧
  • .net 網(wǎng)站制作百度app怎么找人工客服
  • 互聯(lián)網(wǎng)技術(shù)對人力資源管理的影響有哪些seo專員的工作內(nèi)容
  • 網(wǎng)站鏡像代理怎么做百度廣告聯(lián)盟
  • 上海市建設安全協(xié)會網(wǎng)站j搜索引擎優(yōu)化關(guān)鍵字
  • wordpress ip 訪問安卓優(yōu)化大師手機版下載
  • 怎么用代碼做網(wǎng)站查詢網(wǎng)站域名
  • 網(wǎng)站域名哪些后綴更好石家莊谷歌seo
  • 網(wǎng)站建設模板企業(yè)門戶網(wǎng)站模板
  • 盲盒小程序搭建網(wǎng)站優(yōu)化平臺
  • wordpress htwo下載地址網(wǎng)站排名優(yōu)化
  • 商務型企業(yè)網(wǎng)站建設開魯視頻
  • 在阿里巴巴國際網(wǎng)站上需要怎么做鄭州搜索引擎優(yōu)化公司