My book states:
Every program that runs on your computer has a current working directory, or cwd. Any filenames or paths that do not begin with the r
This has nothing to do with osx in particular, it's more of a concept shared by all unix-based systems, and I believe Windows as well. os.getcwd()
is the equivalent of the bash pwd
command - it simply returns the full path of the current location in which you are in. In other words:
alex@suse:~> cd /
alex@suse:/> python
Python 2.7.12 (default, Jul 01 2016, 15:34:22) [GCC] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.getcwd()
'/'
It depends from where you started the python shell/script.