一个python脚本激活virtualenv然后运行另一个python脚本? [英] A python script that activates the virtualenv and then runs another python script?
本文介绍了一个python脚本激活virtualenv然后运行另一个python脚本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在Windows vista上,我需要一个脚本启动 activate
(激活virtualenv)脚本
On windows vista, I need a script that starts the activate
(to activate the virtualenv) script in
C:\Users\Admin\Desktop\venv\Scripts\
稍后,在虚拟环境中,开始到文件夹中的 manage.py runserver
:
And later, in the virtual environment, starts to the manage.py runserver
in the folder :
C:\Users\Admin\Desktop\helloworld\
我应该怎么办?应该使用哪些模块?
how should I do? What modules should I use?
推荐答案
您可以激活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
这篇关于一个python脚本激活virtualenv然后运行另一个python脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文