Get path of current python file

Although rather trivial, but every time I am still looking it up:

import os
dir = os.path.dirname(os.path.realpath(__file__))