nutritious-minister-3808
08/16/2022, 1:01 PM-i/path/to/venv/bin/python -i script.py arg1 arg2/path/to/venvancient-breakfast-45303
08/16/2022, 1:45 PMPEX_INTERPRETER=1 ./my.pex <myscript> arg1enough-analyst-54434
08/16/2022, 1:45 PM$ pex ansicolors -o ansicolors.pex
$ cat <<EOF > script.py
> import colors
> 
> print(colors.blue("Interactive?"))
> EOF
$ ./ansicolors.pex -i script.py 
Interactive?
Traceback (most recent call last):
  File "/home/jsirois/.pex/unzipped_pexes/28923b82caa398e274ae9593d6da0cfb4344ef1a/__main__.py", line 103, in <module>
    bootstrap_pex(__entry_point__, execute=__execute__, venv_dir=__venv_dir__)
  File "/home/jsirois/.pex/unzipped_pexes/28923b82caa398e274ae9593d6da0cfb4344ef1a/.bootstrap/pex/pex_bootstrapper.py", line 601, in bootstrap_pex
    pex.PEX(entry_point).execute()
  File "/home/jsirois/.pex/unzipped_pexes/28923b82caa398e274ae9593d6da0cfb4344ef1a/.bootstrap/pex/pex.py", line 540, in execute
    sys.exit(self._wrap_coverage(self._wrap_profiling, self._execute))
SystemExit
>>>$ pex cowsay --script cowsay -o cowsay.pex --venv prepend
$ ./cowsay.pex 'Moo!'
  ____
| Moo! |
  ====
    \
     \
       ^__^
       (oo)\_______
       (__)\       )\/\
           ||----w |
           ||     ||
$ PEX_INTERPRETER=1 ./cowsay.pex -c 'import cowsay; cowsay.tux("Quack?")'
  ______
| Quack? |
  ======
           \
            \
             \
              .--.
             |o_o |
             |:_/ |
            //   \ \
           (|     | )
          /'\_   _/`\
          \___)=(___/
$ cat <<EOF > script.py
import cowsay
cowsay.tux("It's good for you!")
EOF
$ PEX_INTERPRETER=1 ./cowsay.pex -i script.py 
Re-executing with Python interpreter options: cmdline='/home/jsirois/.pex/venvs/c16958b5b5ab036132bf7669f3d56e9ae1315ac0/5985ed09b49a653d6596b0e14d134c5456cf1a9f/bin/python -i /home/jsirois/.pex/venvs/c16958b5b5ab036132bf7669f3d56e9ae1315ac0/5985ed09b49a653d6596b0e14d134c5456cf1a9f/pex script.py'
  _________
| script.py |
  =========
         \
          \
            ^__^
            (oo)\_______
            (__)\       )\/\
                ||----w |
                ||     ||
Traceback (most recent call last):
  File "/home/jsirois/.pex/venvs/c16958b5b5ab036132bf7669f3d56e9ae1315ac0/5985ed09b49a653d6596b0e14d134c5456cf1a9f/pex", line 245, in <module>
    sys.exit(func())
SystemExit
>>>enough-analyst-54434
08/16/2022, 1:48 PMnutritious-minister-3808
08/16/2022, 1:54 PM