I'm trying to create a utility CLI that creates an empty python project with just a .venv inside.
One of the features I wanted is that, when the CLI ends the project creation, it leaves the bash inside the project folder and with the virtualenv activated. This way:
(base) ubuntu@pc:~/dev/cli$ python cli.py start ./folder
... do it's magic ...
... and ends up like this:
(.venv) ubuntu@pc:~/dev/cli/folder$
Note that now the cwd is inside folder and **(.venv) ** is activated.
I was able to achieve part of my objective (change the folder) by using:
import os
os.chdir("./folder")
os.execl("/bin/bash", "/bin/bash")
But didn't find a way to keep the venv activated after the program is halted.
Any ideas??