the __FILE__ is a convenient macro designed to access current FILE path in python. But there's some issue with it when I use it. I have a file say /home/a/b.py so when accessed from directory a the __FILE__ macro in b.py should give /home/a/b.py
which is correct. But I then created a symbol link under /var/www/a -> /hom/a so when the b.py is accessed from /var/www/a I would expect macro in b.py to give the path /var/www/a/b.py
. But this is not the case. although the file is accessed form symbol path /var/www/a, the macro is still giving the real file path /home/a/b.py
I've tried abspath and realpath in python os package. is there any api that can peel out the symbolic path I wanted?