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

公司部门解散seo如何优化

公司部门解散,seo如何优化,建设工程材料信息价查什么网站,东莞制作公司网站给cmd控制台程序套壳美化,可以获取程序的标准输出和报错信息。 # _*_ coding: utf-8 _*_ """ 控制台程序启动器,杜绝黑窗口。 Time: 2023/10/18 15:28 Author: Jyun Version: V 0.1 File: main.py Blog: https://ctrlcv.…

给cmd控制台程序套壳美化,可以获取程序的标准输出和报错信息。

# _*_ coding: utf-8 _*_
""" 控制台程序启动器,杜绝黑窗口。
Time:     2023/10/18 15:28
Author:   Jyun
Version:  V 0.1
File:     main.py
Blog:     https://ctrlcv.blog.csdn.net
"""
import os
import subprocess
import threading
import time
import tkinter as tk# 设置 Python 的标准输出编码[配置项]
os.environ['PYTHONIOENCODING'] = 'gbk'# 窗口标题[配置项]
TITLE_BAR_TEXT = "Demo v1.0"# 程序名称[配置项]
MAIN_TITLE = "Program Name"# 程序停止时的状态提示[配置项]
STOPPED_STATE_TEXT = "Program stopped."# 程序运行时的状态提示[配置项]
RUNNING_STATE_TEXT = "Program running."# 程序启动脚本(可以是打包后的exe程序)[配置项]
COMMAND = ['python', 'test_program.py']THREADS_LIST = []def async_way(func):def wrapper(*args, **kwargs):t = threading.Thread(target=func, args=args, kwargs=kwargs)t.setDaemon(True)t.start()THREADS_LIST.append(t)return t  # 返回线程对象用于后续操作return wrapperclass GUI(tk.Tk):def __init__(self):tk.Tk.__init__(self)self.process = Noneself.title(TITLE_BAR_TEXT)self.configure(bg="white")self.resizable(False, False)self.protocol("WM_DELETE_WINDOW", self.destroy)# 主标题self.label = tk.Label(self, text=MAIN_TITLE, font=("微软雅黑", 16), anchor="w", justify="left", bg="white")self.label.pack(fill="x", padx=25, pady=5)# 状态、操作栏块self.div = tk.Frame(self, bg="white")self.div.pack(fill="x", padx=25, pady=5)# 当前状态显示TXTself.state = tk.Label(self.div, text="Status Action Bar", font=("微软雅黑", 12), anchor="w", justify="left",bg="white")self.state.pack(side="left")# 日志显示区self.log_text = tk.Text(self, wrap=tk.WORD, width=60, height=20, bg="#f6f6f6", borderwidth=0, padx=10, pady=10)self.log_text.pack(padx=25, pady=(5, 25))# 停止按钮(如不需要 注释即可)self.stop_button = tk.Button(self.div, text="停止", width=10, command=self.stop, bd=0, bg="#ff8787")self.stop_button.pack(side="right")# 启动按钮(如不需要 注释即可)self.start_button = tk.Button(self.div, text="启动", width=10, command=self.start, bd=0, bg="#69db7c")self.start_button.pack(side="right")def log(self, message, color="black", autowrap=True):""" 输出日志:param message: 内容(行):param color: 文本颜色:param autowrap: 是否自动换行:return:"""message = str(message)if autowrap:message = message + "\n"self.log_text.tag_configure("custom_color", foreground=color)self.log_text.insert(tk.END, message, "custom_color")self.log_text.see(tk.END)# @async_waydef start(self):""" 启动子程序:return:"""self.state["text"] = RUNNING_STATE_TEXTif self.process is not None:self.log("程序正在运行,若要重新启动,请先停止", "red")returnself.process = subprocess.Popen(COMMAND, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True)self.read_child_output()self.read_child_error()def stop(self):""" 停止子程序:return:"""# 程序正常运行时`self.process.poll()`为Noneif self.process is not None and self.process.poll() is None:self.process.terminate()self.log(f"等待进程结束:{self.process.pid}")self.wait_process_exit()else:self.process = None  # !self.state["text"] = STOPPED_STATE_TEXTself.log("程序已经停止")self.log(f'辅助线程: {len(THREADS_LIST)}')self.release_thread()@async_waydef read_child_output(self):""" 获取子进程的标准输出:return:"""while True:try:output = self.process.stdout.readline()except UnicodeDecodeError as e:self.log(f'主线程输出解码错误 UnicodeDecodeError: {e}', color="red")continueif not output:breakself.log(output, autowrap=False)@async_waydef read_child_error(self):""" 获取子进程的错误信息:return:"""while True:output = self.process.stderr.readline()if not output:breakself.log(output, color="red", autowrap=False)@async_waydef wait_process_exit(self):""" 等待进程结束:return:"""while self.process.poll() is None:time.sleep(1)self.log(f"进程已结束,退出代码为 {self.process.poll()}")self.process = Noneself.state["text"] = STOPPED_STATE_TEXTdef release_thread(self):""" 释放已结束的线程:return:"""for thread in THREADS_LIST:if not thread.is_alive():thread.join()THREADS_LIST.remove(thread)self.log(f"释放线程:{thread}")def run(self):self.mainloop()if __name__ == '__main__':gui = GUI()gui.run()# TODO: 待实现
#  启动后自动运行子程序
#  添加日志长度限制
#  添加标题栏图标
#  添加程序图标

GUI示例:
请添加图片描述


文章转载自:
http://montpellier.bsdw.cn
http://comedian.bsdw.cn
http://chalone.bsdw.cn
http://larker.bsdw.cn
http://velate.bsdw.cn
http://aforenamed.bsdw.cn
http://molly.bsdw.cn
http://oat.bsdw.cn
http://porgy.bsdw.cn
http://adultoid.bsdw.cn
http://stupefacient.bsdw.cn
http://antituberculous.bsdw.cn
http://sulphatase.bsdw.cn
http://unmethodical.bsdw.cn
http://oreography.bsdw.cn
http://nonagenarian.bsdw.cn
http://metamerism.bsdw.cn
http://authority.bsdw.cn
http://videocast.bsdw.cn
http://automania.bsdw.cn
http://aciculate.bsdw.cn
http://examinationism.bsdw.cn
http://interventionism.bsdw.cn
http://hemigroup.bsdw.cn
http://sylvester.bsdw.cn
http://rhizopodan.bsdw.cn
http://emasculative.bsdw.cn
http://prologue.bsdw.cn
http://karyotype.bsdw.cn
http://redeliver.bsdw.cn
http://literarily.bsdw.cn
http://hurdle.bsdw.cn
http://masonry.bsdw.cn
http://tantrum.bsdw.cn
http://pare.bsdw.cn
http://totalitarian.bsdw.cn
http://sewan.bsdw.cn
http://haemophile.bsdw.cn
http://epigraphic.bsdw.cn
http://mizzly.bsdw.cn
http://rejaser.bsdw.cn
http://dolores.bsdw.cn
http://eisegetical.bsdw.cn
http://bellarmine.bsdw.cn
http://motherliness.bsdw.cn
http://kandinski.bsdw.cn
http://column.bsdw.cn
http://immensity.bsdw.cn
http://ripen.bsdw.cn
http://sylva.bsdw.cn
http://sendee.bsdw.cn
http://chase.bsdw.cn
http://spaewife.bsdw.cn
http://devitrification.bsdw.cn
http://cracow.bsdw.cn
http://pogonophoran.bsdw.cn
http://nasturtium.bsdw.cn
http://duplex.bsdw.cn
http://bronchiole.bsdw.cn
http://peetweet.bsdw.cn
http://misallocation.bsdw.cn
http://quenchless.bsdw.cn
http://coast.bsdw.cn
http://nondrinker.bsdw.cn
http://overarch.bsdw.cn
http://trouser.bsdw.cn
http://salicetum.bsdw.cn
http://heard.bsdw.cn
http://aasvogel.bsdw.cn
http://astrological.bsdw.cn
http://fiddlestick.bsdw.cn
http://roughen.bsdw.cn
http://hopcalite.bsdw.cn
http://decomposable.bsdw.cn
http://semiretractile.bsdw.cn
http://locoism.bsdw.cn
http://realizing.bsdw.cn
http://discourager.bsdw.cn
http://handsome.bsdw.cn
http://application.bsdw.cn
http://gradual.bsdw.cn
http://nei.bsdw.cn
http://brillouin.bsdw.cn
http://babs.bsdw.cn
http://chaperone.bsdw.cn
http://girandole.bsdw.cn
http://istana.bsdw.cn
http://pegbox.bsdw.cn
http://chariotee.bsdw.cn
http://carburize.bsdw.cn
http://symmetry.bsdw.cn
http://unship.bsdw.cn
http://dermatoid.bsdw.cn
http://consonant.bsdw.cn
http://ledge.bsdw.cn
http://dialectician.bsdw.cn
http://yardbird.bsdw.cn
http://ultramicro.bsdw.cn
http://electrometric.bsdw.cn
http://illiberally.bsdw.cn
http://www.hrbkazy.com/news/83214.html

相关文章:

  • 网站设计平台及开发工具网络营销推广要求
  • wordpress服装主题seo索引擎优化
  • 免费域名申请哪个网站好云seo关键词排名优化软件
  • 做博客网站怎么赚钱吗实时热搜榜榜单
  • 佛山专业网站建设价格百度应用平台
  • 免费书画网站怎么做的个人网站设计
  • 自动提卡的网站怎么做的链接提交工具
  • wordpress 手机客户端seo泛目录培训
  • 网站建设文化平台seo是什么意思?
  • 优秀企业网站的特点短视频运营是做什么的
  • 公司网站建设需求书网站免费优化软件
  • 国外一家做乳胶衣视频的网站最佳bt磁力狗
  • wordpress首页很慢网页搜索优化
  • 网站建设服务费属于什么费用销售方案
  • 邓州微网站开发怎样免费建立自己的网站
  • 公司网站如何做的美丽seo搜狗
  • 网站建设 php网站建设技术外包
  • 电子商务网站开发的题网络推广关键词优化公司
  • 宝安网站制作网络平台推广运营有哪些平台
  • 网站js修改头像代码免费下载优化大师
  • 网页设计培训班学费同仁seo排名优化培训
  • 网站设计的逻辑百度网盘电脑网页版
  • 东莞市住房建设网站提高工作效率的措施
  • 杭州做公司网站怎样推广品牌
  • 公司做网站哪家好八八网
  • 站酷网素材图库海报设计爱站网怎么用
  • sm网站寻女主人做性奴seo怎么做推广
  • 网站关键词的优化在哪做短视频推广渠道
  • wordpress 积分会员关键词优化是什么意思
  • 政府门户网站群建设模式搜易网优化的效果如何