Detect nuitka on the fly
See original GitHub issueHello,
I wrote a piece of code that asks for admin rights on Windows / Linux and if not found, asks for elevation. On Windows, it will ask for UAC elevation, keeps exit codes and allows to keep commandline arguments. On Linux, it will try to rerun with sudo, keeping exit codes, output and commandline arguments too. It currently works with the Nuitka compiler, and packagers like PyInstaller, py2exe, cx_freeze.
As of today, I’m using a sloppy nuitka detection on windows using:
sys.argv[0].endswith('.exe')
It gets worse when running on linux 😃
On the other packagers, generally sys gets a frozen attribute that can be checked with:
getattr(sys, "frozen", False)
Is there any way to detect if current script is Nuitka compiled ? Like a constant or a variable that is set globally in a compiled nuitka program ?
Best regards.
Issue Analytics
- State:
- Created 5 years ago
- Comments:12 (11 by maintainers)
Top GitHub Comments
This is long released as 0.6.2 already.
I don’t get what’s missing here:
The oypy version info has only less. Notice, the last two fields are only in the upcoming release.
Yours, Kay