且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

一个python脚本激活virtualenv然后运行另一个python脚本?

更新时间:2023-01-08 18:02:20

您可以激活virtualenv,然后使用bat文件启动服务器。
将此脚本复制到一个文件中并用.bat扩展名保存(例如runserver.bat)

You can activate your virtualenv and then start server using a bat file. Copy this script in to a file and save it with .bat extension (eg. runserver.bat)

@echo off
cmd /k "cd /d C:\Users\Admin\Desktop\venv\Scripts & activate & cd /d    C:\Users\Admin\Desktop\helloworld & python manage.py runserver"

然后你可以运行这个bat文件点击)启动服务器

Then you can just run this bat file (just double click) to start the server