I have the following line of code which I think is not correct:
path_dir = os.path.abspath(os.path.join(os.path.dirname(__file__)))
where os.path.dirname(__file__)
looks for a script.
I understand that os.path.abspath()
gives you the absolute path of a file or a directory but os.path.join()
combines two strings together but for that we need to have 2 paths. i.e. path_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.path.pardir)))
Am I correct in thinking that the above code is incorrect and broken?