I'm trying to remove a directory and I guess i'm having an issue with defining the path for the shutil.rmtree()
. Does this function take the relative path or the absolute. I use win10 and am having problem understanding how the paths can and should be defined in python, because it seems that for every function the path needs to be defined in a different way.
import shutil
dir_to_remove = "C:\\Users\name_of_user\\dir_to remove"
shutil.rmtree(dir_to_remove)
Result is:
Traceback (most recent call last):
File "<ipython-input-257-9cc5f9fe51d2>", line 1, in <module>
shutil.rmtree(dir_to_remove)
TypeError: 'str' object is not callable
Any help or guidance is appreciated.