minimal adjustments
[dotfiles/.git] / .config / coc / extensions / node_modules / coc-python / pythonFiles / datascience / getJupyterVariableList.py
1 # Query Jupyter server for defined variables list
2 # Tested on 2.7 and 3.6
3 from sys import getsizeof
4 import json
5
6 # who_ls is a Jupyter line magic to fetch currently defined vars
7 _VSCode_JupyterVars = %who_ls
8
9 print(json.dumps([{'name': var,
10                    'type': type(eval(var)).__name__,
11                    'size': getsizeof(var),
12                    'expensive': True
13                    } for var in _VSCode_JupyterVars]))