700字范文,内容丰富有趣,生活中的好帮手!
700字范文 > pyinstaller打包生成的exe文件并使用python终止后台的exe程序运行

pyinstaller打包生成的exe文件并使用python终止后台的exe程序运行

时间:2023-05-02 09:27:55

相关推荐

pyinstaller打包生成的exe文件并使用python终止后台的exe程序运行

pyinstaller打包生成的exe文件并使用python终止后台的exe程序运行

目录

pyinstaller打包生成的exe文件并使用python终止后台的exe程序运行

#pyinstaller打包生成的exe文件

#杀死指定的exe程序

#test.bat文件内容

#pyinstaller打包生成的exe文件

#执行打包的过程

pyinstaller --clean --onefile test.py

#生成的文件;

"D:\\test.exe"

双击exe会生成cmd的窗口

#杀死指定的exe程序

import osos.system("taskkill /f /im test.exe")#test.batos.system("taskkill /f /im test.bat")

#test.bat文件内容

@echo off cd d:\teststart test.exeexit

参考:R

参考:Is it possible to kill a process on Windows from within Python?

本内容不代表本网观点和政治立场,如有侵犯你的权益请联系我们处理。
网友评论
网友评论仅供其表达个人看法,并不表明网站立场。