Re: [Python-ideas] Re: Add venv activate command to the venv modules
Hello, On Mon, 4 Jan 2021 21:07:23 +0400 Abdur-Rahmaan Janhangeer <arj.python@gmail.com> wrote:
@Christopher Barker <pythonchb@gmail.com>
You nailed it! I've used the conda activate command many times. It should in theory be possible in Python
@Chris Angelico <rosuav@gmail.com>
Yes mere shell commands passing via Py does not work, maybe a file way with results in current shell as @M.-A. Lemburg <mal@egenix.com> points out, venv already generates the files. On windows it has an activate.bat
Knowing that, you're a step away from creating a "subshell" solution for *yourself*. For POSIX systems, that would be: venv-shell.sh: ---- . $1/bin/activate /bins/sh ---- Voila! If you want to add "--shell" switch to "python3 -m venv" with that functionality, to benefit the whole mankind, not just yourself, I'm +1. I'd say, you can start writing a patch for that. But I'd warn you that it likely will be rejected, as it will require a bunch of sustained user support (i.e. it won't work as expected on various OSes and various shells). -- Best regards, Paul mailto:pmiscml@gmail.com
participants (1)
-
Paul Sokolovsky