0

使用pex工具打包python项目(https://pex.readthedocs.io/en/v2.1.55/);有没有办法知道原始 Pex 文件的位置?到目前为止,我只能看到“解压缩”文件的位置,但需要以编程方式解析原始文件位置,因为程序可以在不同的环境下运行。我有一个测试脚本 ~/print_location.py

import pathlib

print(pathlib.Path(__file__))

和 pex 二进制文件 ~/print_location.pex

输出: /home/usr/.pex/installed_wheels/4d...e5 /print_location-1-py3-none-any.whl/print_location.py

预期: /home/usr/print_location.pex

4

0 回答 0