Created
August 23, 2020 10:21
-
-
Save jaimevalero/5a97c93852286c72af158ad396d14960 to your computer and use it in GitHub Desktop.
Extract user variables in a python session
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> a=1 | |
>>> b=2 | |
>>> c=3 | |
>>> | |
>>> # We will extract user variables, filtering those who do not contain '__' | |
>>> | |
>>> { k:v for k,v in locals().items() if '__' not in k } | |
{'a': 1, 'b': 2, 'c': 3} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment