basedir python code example Example: python get base directory Click to copyimport os os.path.dirname(os.path.realpath(__file__))