demo_python_ref_locals_2.py:
x
 
x = locals()
print(x["__file__"])
C:\Users\My Name>python demo_python_ref_locals_2.py
demo_python_ref_locals_2.py