import subprocess # 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')) # 打开后端服务 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) # 打开前端服务 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\" %*"
标签:shell,v3.7,python,pro,前后,subprocess,vscode,True,jeecg From: https://www.cnblogs.com/meetrice/p/18469950