Use helper functions in os.path correctly