【发布时间】:2022-06-25 09:04:51
【问题描述】:
使用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
【问题讨论】:
标签: python python-pex