引入模块
import subprocess
直接调用
subprocess.Popen(r'C:\emqx\bin\emqx.cmd start')
那么问题来了windows环境怎么办呢?
答:使用批处理文件
echo off
cd \
cd emqx\bin
call emqx.cmd start
cd \
cd updog
call updog
上面那个是网盘要独占一个窗口所以下面网站和它分开写俩个批处理
echo on
cd \
call net start mysql57
cd 20210902
call python 20210902.py runserver -h 0.0.0.0 -p 5001
这玩意扔启动里应该没有什么问题吧~
什么?
2019windows数据中心版没有启动项!?
那就~~~~~找下面这个文件夹,把批处理文件扔这里就能开机自启动
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\StartUp