Error:
Traceback (most recent call last): File "C: \ Python27 \ data \ listener.py", line 94, in back_dir (os.getcwd ()) NameError: name 'back_dir' is not defined
Class that I am using:
class back():
def back_dir(self,current_path):
c=current_path.split('\')
new_path=''
i=0
while i<len(c)-1:
if i!=0:
new_path=new_path+"\"+c[i]
else:
new_path=c[i]
i+=1
os.chdir(new_path)
Part of the code where I get the error:
back_dir(os.getcwd())
However, should it work? You can help me.