SyntaxFix
Write A Post
Hire A Developer
Questions
I use:
import os import sys def get_script_path(): return os.path.dirname(os.path.realpath(sys.argv[0]))
As aiham points out in a comment, you can define this function in a module and use it in different scripts.