SyntaxFix
Write A Post
Hire A Developer
Questions
__file__
as others have said. You may also want to use os.path.realpath to eliminate symlinks:
import os os.path.realpath(__file__)