Utilisez la bibliothèque python-varname.
bash
pip install python-varname
python
from varname import nameof var = 1 nameof(var)
output
var
Recommended Posts