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导入? 2022-01-01
- ";find_element_by_name(';name';)";和&QOOT;FIND_ELEMENT(BY NAME,';NAME';)";之间有什么区别? 2022-01-01
- CTR 中的 AES 如何用于 Python 和 PyCrypto? 2022-01-01
- 我如何卸载 PyTorch? 2022-01-01
- 使用公司代理使Python3.x Slack(松弛客户端) 2022-01-01
- 使用 Cython 将 Python 链接到共享库 2022-01-01
- 如何使用PYSPARK从Spark获得批次行 2022-01-01
- 计算测试数量的Python单元测试 2022-01-01
- 检查具有纬度和经度的地理点是否在 shapefile 中 2022-01-01
- YouTube API v3 返回截断的观看记录 2022-01-01