Search code examples
pythonpython-3.xsys

What does sys.path.append("..") do?


I bumped into this statement in a Python script: sys.path.append("..") I did some research, but I could not find what it does.

I know sys.path.append() function appends a path at the end of the PYTHONPATH list. But what does ".." stand for?

Needless to say, this Python scripts does not work if I comment the line.


Solution

  • ".." is a way of saying/referencing the parent of the current working directory.