Small fixes
Use dirname instead of split os.path.dirname() is identical to os.path.split()[0] see: https://docs.python.org/3/library/os.path.html#os.path.dirname
Use dirname instead of split os.path.dirname() is identical to os.path.split()[0] see: https://docs.python.org/3/library/os.path.html#os.path.dirname