[Distutils] restart-in-venv (was: PEX at Twitter (re: PEX - Twitter's multi-platform executable archive format for Python))

Nick Coghlan ncoghlan at gmail.com
Tue Feb 4 16:05:25 CET 2014


On 5 February 2014 00:33, Vinay Sajip <vinay_sajip at yahoo.co.uk> wrote:
> def main():
>     if '-e' found in sys.argv:
>         validate the passed parameter, prepare a new command line
>         using the interpreter from the venv and the sys.argv passed in,
>         but minus the -e bit, since we've dealt with that here
>         call subprocess with that command line (the restart)
>         return - our work here is done
>     # Do stuff with sys.argv

That only works if the system site packages is configured to be
visible inside the virtual environment - it usually isn't these days.

Cheers,
Nick.

-- 
Nick Coghlan   |   ncoghlan at gmail.com   |   Brisbane, Australia


More information about the Distutils-SIG mailing list