Skip to content

Instantly share code, notes, and snippets.

@gyrospectre
Created October 4, 2021 01:23
Show Gist options
  • Save gyrospectre/1148f483af4e7e2cea4d807f1cb2b7cc to your computer and use it in GitHub Desktop.
Save gyrospectre/1148f483af4e7e2cea4d807f1cb2b7cc to your computer and use it in GitHub Desktop.
def get_stackinfo():
stack = inspect.stack()
stack_hash = hashlib.sha256(str(stack).encode('utf-8')).hexdigest()
stack_info = {
'stack_hash': stack_hash,
'entry_frame': {
'filename': stack[-1].filename,
'code_context': stack[-1].code_context
}
}
return stack_info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment