A Python script that activates the virtualenv and then runs another Python script?(激活 virtualenv 然后运行另一个 Python 脚本的 Python 脚本?)
问题描述
在 Windows Vista 上,我需要一个启动 activate(以激活 virtualenv)脚本的脚本:
On Windows Vista, I need a script that starts the activate (to activate the virtualenv) script in:
C:UsersAdminDesktopvenvScripts
然后,在虚拟环境中,启动到manage.py runserver文件夹中:
And later, in the virtual environment, starts to the manage.py runserver in the folder:
C:UsersAdminDesktophelloworld
我该怎么办?我应该使用哪些模块?
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:UsersAdminDesktopvenvScripts & activate & cd /d C:UsersAdminDesktophelloworld & python manage.py runserver"
然后你可以运行这个bat文件(只需双击)来启动服务器
Then you can just run this bat file (just double click) to start the server
这篇关于激活 virtualenv 然后运行另一个 Python 脚本的 Python 脚本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:激活 virtualenv 然后运行另一个 Python 脚本的 Python 脚本?
基础教程推荐
- 在Python中从Azure BLOB存储中读取文件 2022-01-01
- PermissionError: pip 从 8.1.1 升级到 8.1.2 2022-01-01
- 修改列表中的数据帧不起作用 2022-01-01
- PANDA VALUE_COUNTS包含GROUP BY之前的所有值 2022-01-01
- 使用大型矩阵时禁止 Pycharm 输出中的自动换行符 2022-01-01
- 无法导入 Pytorch [WinError 126] 找不到指定的模块 2022-01-01
- 包装空间模型 2022-01-01
- 在同一图形上绘制Bokeh的烛台和音量条 2022-01-01
- Plotly:如何设置绘图图形的样式,使其不显示缺失日期的间隙? 2022-01-01
- 求两个直方图的卷积 2022-01-01
