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 脚本?


基础教程推荐
- 对多索引数据帧的列进行排序 2022-01-01
- kivy 应用程序中的一个简单网页作为小部件 2022-01-01
- 比较两个文本文件以找出差异并将它们输出到新的文本文件 2022-01-01
- 在 Django Admin 中使用内联 OneToOneField 2022-01-01
- 究竟什么是“容器"?在蟒蛇?(以及所有的 python 容器类型是什么?) 2022-01-01
- Kivy 使用 opencv.调整图像大小 2022-01-01
- Python 中是否有任何支持将长字符串转储为块文字或折叠块的 yaml 库? 2022-01-01
- matplotlib 设置 yaxis 标签大小 2022-01-01
- Python,确定字符串是否应转换为 Int 或 Float 2022-01-01
- 在 Python 中将货币解析为数字 2022-01-01