(Python)exe启动工具,,心力交瘁,写了个小程
(Python)exe启动工具,,心力交瘁,写了个小程
心力交瘁,写了个小程序
配合配置文件实现延迟启动exe
自动忽略带 “#” 开头的行
ini 范本 这是路径 这是延迟(秒)C:\Users\1.exe -n1 C:\Users\2.exe -n5
.py
1 import time 2 import win32api ,threading,os 3 4 5 def run1(l,s): 6 print("ok",l) 7 time.sleep(s) 8 win32api.ShellExecute(0,"open",l,"","",0) 9 10 11 12 13 txt = open("123.txt","r")14 dic = dict()15 print (os.path.abspath(‘.‘))16 for lin in txt:17 lin2 = []18 lin = lin.strip()19 20 if len(lin) > 0 and lin[0] != "#":21 22 if lin.count("\n") == len(lin):23 24 pass25 26 else:27 lin2 = lin.strip().split("-n")28 if len(lin2) == 2:29 30 31 t = threading.Thread(target=run1,args=(lin2[0],int(lin2[1])))32 33 t.start()34 txt.close()35 t.join()36 exit()
小结 :
并没有吃透
网上搜索,东拼西凑,各种尝试,终于倒腾出来了。。
想加个日志功能,但是好像有点复杂
好像并没有明显BUG (也没有认真测试 - -!)
(Python)exe启动工具
相关内容
- openstack keystone 安装依赖关系,,python set
- 使用python获得activemq信息(通过http://server:8161/,, 1 #
- Python 中 tablib 模块的使用,,公司有个需求,需要把
- python3安装后运行出错:error while loading shared libraries:
- 在 Xcode 里编译运行 Python 代码,,Xcode有着良好的
- python--运算符,字符编码,,运算符a += 20
- python 关闭垃圾回收,,importgc g
- python—networkx:在一张图中画出多个子图,,通过plt.su
- python3 win10_x64 安装pcapy,,稀里糊涂就装上了大概
- Windows上virtualenv搭建python开发环境,,本文主要记录在搭
评论关闭