To turn on Python Development Mode, you can use this flag:
python3 -X dev example.py
or use this environment variable:
PYTHONDEVMODE=1 python3 example.py
How can I write code within example.py to detect whether Python is running in Python Development Mode or not?
__debug__os.environ__debug__is True even when Python Development Mode is not on. I just tried it by runningpython3and then runningpython3 -X dev