Path has the ability to used like os.path.join:
from pathlib import Path parent = Path(__file__).parent car_pic = Path(parent, 'Data', 'Pics', 'Car.png')Also os.path.absolute is not needed:
parent = Path(__file__).parent.absolute()Functions/Methods were added since Python 3.5. I use it with Python 3.6, but I can't memorize the missing functions/methods in older versions.
Almost dead, but too lazy to die: https://sourceserver.info
All humans together. We don't need politicians!
All humans together. We don't need politicians!