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将MP3转换为MIDI(类型错误:无法加载插件:mtg-Melodia:Melodia) 2022-01-01
- 在 Celery 工作人员中捕获 Heroku SIGTERM 以优雅地关 2022-01-01
- 用 Python 编写 Fortran 无格式文件 2022-01-01
- 与常规 dict 相比,Python manager.dict() 非常慢 2022-01-01
- 将 x 轴刻度更改为自定义字符串 2022-01-01
- 尝试制作WhatsApp机器人 2022-01-01
- Discord.py 缺少必需的参数 2022-01-01
- 使用生成器和迭代器时 Python 多循环失败 2022-01-01
- pyserial - 可以从线程 a 写入串行端口,是否阻塞从线程 b 读取? 2022-01-01
- numpy float:比算术运算中内置的慢 10 倍? 2022-01-01
