Can anyone say how to detect if code is running in an exe created by Nuitka or in a normal python interpreter?
I think I would ideally like an "is_nuitka" flag that would be set to True when compiled and presumably not exist at all when not compiled.
Could then use code like this:
if '__is_nuitka__' in locals() or '__is_nuitka__' in globals():
print('debug info: running in nuitka mode')
Any suggestions? Is there anything like this available? any alternative approaches?
Starting with Nuitka 0.6.2, you can use this code:
is_nuitka = "__compiled__" in globals()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With