I have a python script in PythonCode folder. I want that I should get the path excluding the PythonCode from it when using os.path.dirname(__file__), currently when I am using os.path.dirname(__file__) it is returning this:-
C:\Users\xyz\Documents\ABC\Python Code
but I need this path:-
C:\Users\xyz\Documents\ABC\
import os
dirname = os.path.dirname(__file__)
print (dirname)