Skip to content

Instantly share code, notes, and snippets.

@Mufanc
Created March 25, 2023 17:16
Show Gist options
  • Save Mufanc/6bccba398a787ed49c6b619740fb5d29 to your computer and use it in GitHub Desktop.
Save Mufanc/6bccba398a787ed49c6b619740fb5d29 to your computer and use it in GitHub Desktop.
import inspect
import re
for info in inspect.stack():
if re.fullmatch('<.*>', info.filename):
continue
frame = info.frame
print('-' * 50)
print(f'# {info.filename}')
print(inspect.getsource(inspect.getmodule(frame)))
exit()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment