https://pantsbuild.org/ logo
#general
Title
# general
r

refined-addition-53644

12/12/2022, 8:03 PM
I think this has been asked already but I'm struggling to run random script wrapped inside a PEX which is generated using
pex_binary
in
venv
mode. I didn't set any of these scripts as an entry point. Is this possible?
1
e

enough-analyst-54434

12/12/2022, 8:05 PM
What means of run? Is it via
subprocess
?
r

refined-addition-53644

12/12/2022, 8:05 PM
no just
python <script_location_inside_pex>
? I am not sure if that’s how you would do it though
e

enough-analyst-54434

12/12/2022, 8:07 PM
pex --help-variables
is your friend, but
PEX_MODULE=package.module:function the/pex/file.pex
or
PEX_MODULE=package.module:function python the/pex/file.pex
👍 1
There is also
PEX_SCRIPT
to have it run a console script from one of the 3rdparty distributions inside it.
r

refined-addition-53644

12/12/2022, 8:13 PM
Yeah I was trying to use
PEX_SCRIPT
but somehow missed
PEX_MODULE
. That works! Thank you!