>>> import os
>>> cwd = os.getcwd()
>>> cwd
'/home/dinsdale'
cwd stands for “current working directory”. The result in this example is /home/dinsdale, which is the home directory of a user named dinsdale.
A string like '/home/dinsdale' that identifies a file or directory is called a path.
A simple filename, like memo.txt is also considered a path, but it is a relative path because it relates to the current directory. If the current directory is /home/dinsdale, the filename memo.txt would refer to /home/dinsdale/memo.txt.
A path that begins with / does not depend on the current directory; it is called an absolute path. To find the absolute path to a file, you can use os.path.abspath: