Skip to content

Instantly share code, notes, and snippets.

@hunj
Created July 11, 2018 15:46
Show Gist options
  • Save hunj/9ccc2bde60059b271ea578c4cb8ce41a to your computer and use it in GitHub Desktop.
Save hunj/9ccc2bde60059b271ea578c4cb8ce41a to your computer and use it in GitHub Desktop.
[Python] Inspect params inside a function
import inspect
frame = inspect.currentframe()
args, _, _, values = inspect.getargvalues(frame)
print('function name "%s"' % inspect.getframeinfo(frame)[2])
for i in args:
print(" %s = %s" % (i, values[i]))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment