ITADN
ofek/pyapp/Issues

How to detect at runtime if app is running from a PyApp bundle? 🤔

#195Closedhasansezertasan 创建于 2025-07-03
H
hasansezertasancommented
Hi everyone 👋. First of all, thanks for the work on PyApp — it's been working well for my needs so far 🙌. I recently switched from PyInstaller, and I'm trying to achieve something similar to what we could do there: detect at runtime whether the application is running from source or as a bundled executable 📦. With PyInstaller, we could use the following code to distinguish between bundled and normal runs: ```python import sys if getattr(sys, 'frozen', False) and hasattr(sys, '_MEIPASS'): print('running in a PyInstaller bundle') else: print('running in a normal Python process') ``` Is there a recommended way to do this in PyApp? I couldn't find anything in the documentation or the public API that would provide similar information 📄. Just to clarify, this is not a feature request — I'm only asking whether there's an equivalent mechanism or best practice for this scenario ✅. Thanks in advance! 🙏.
关闭于 2025-07-03 1 条评论