bat批处理执行python 的几种方式 ———— 批处理, python打包成 exe文件

mac2022-06-30  21

批处理

1.

@echo off C: cd C:\Users\ldl\Desktop start python test100.py start python 1.py start python 1.py 10 start python 1.py 100 exit

2.我用的是第二种,第一种不知道为什么没成功,会闪退。

start cmd /K "C:&&cd C:\Users\ldl\Desktop&&python test10.py " start cmd /K "C:&&cd C:\Users\ldl\Desktop&&python test100.py " start cmd /K "C:&&cd C:\Users\ldl\Desktop&&python test1000.py " start cmd /K "C:&&cd C:\Users\ldl\Desktop&&python test10000.py "

 python打包成 exe文件

首先安装包: pip install pyinstaller 速度慢可以添加国内源 安装成功后, 在当前的文件夹路径下 运行命令 pyinstaller ***.py 文件 接着会自动打包成一个可执行的 exe文件 ,点击这个可执行文件即可

最新回复(0)