Skip to content

Instantly share code, notes, and snippets.

@Syzygianinfern0
Created July 27, 2023 22:45
Show Gist options
  • Save Syzygianinfern0/4198fb7b5af3ab2171bd77370a2befed to your computer and use it in GitHub Desktop.
Save Syzygianinfern0/4198fb7b5af3ab2171bd77370a2befed to your computer and use it in GitHub Desktop.
Find out if python code is being executed by a debugger
import sys
def is_being_debugged():
return sys.gettrace() is not None
if is_being_debugged():
print("The script is being debugged")
else:
print("The script is not being debugged")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment