python批处理,一键打开vscode窗口,分别加载jeecg前后端项目,并运行前后端服务.

复制代码
import subprocess
import time
# VsCode打开后端项目 cmd1 = ["code","D:\pro\JeecgBoot-v3.7.1\jeecg-boot"] process1 = subprocess.Popen(cmd1, stdout=subprocess.PIPE, shell=True) output1, _ = process1.communicate() print(output1.decode('utf-8')) # VsCode打开前端项目 cmd2 = ["code", "D:\pro\JeecgBoot-v3.7.1\jeecgboot-vue3"] process2 = subprocess.Popen(cmd2, stdout=subprocess.PIPE, shell=True) output2, _ = process2.communicate() print(output2.decode('utf-8'))
time.sleep(20)
# 打开后端服务 cmd3 = ['start', 'cmd', '/k', 'cd D:\pro\JeecgBoot-v3.7.1\jeecg-boot && java -cp D:/pro/JeecgBoot-v3.7.1/jeecg-boot/classpath.jar org.jeecg.JeecgSystemApplication'] subprocess.run(cmd3, shell=True, check=True)
time.sleep(20)
# 打开前端服务 cmd4 = ['start', 'cmd', '/k', 'cd D:\pro\JeecgBoot-v3.7.1\jeecgboot-vue3 && yarn run dev'] subprocess.run(cmd4, shell=True, check=True)
复制代码

win11添加右键运行python文件

Windows Registry Editor Version 5.00


[HKEY_CLASSES_ROOT\SystemFileAssociations\.py\shell\Run]
"Icon"="D:\\dev\\python_icon.ico"

[HKEY_CLASSES_ROOT\SystemFileAssociations\.py\shell\Run\Command]
@="D:\\dev\\Python396\\python.exe \"%1\" %*"

 

posted @   meetrice  阅读(24)  评论(0编辑  收藏  举报
相关博文:
阅读排行:
· 分享4款.NET开源、免费、实用的商城系统
· 全程不用写代码,我用AI程序员写了一个飞机大战
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了
· 上周热点回顾(2.24-3.2)
历史上的今天:
2014-10-16 ivr
2009-10-16 BCB6代码格式化外挂
点击右上角即可分享
微信分享提示