To find this, we use the function/method getcwd(). We import it from the module os.
>>> import os
>>> os.getcwd()
‘C:\\Users\\lifei\\AppData\\Local\\Programs\\Python\\Python36-32’
>>> type(os.getcwd)
<class ‘builtin_function_or_method’>
We can also change the current working directory with chdir().
>>> os.chdir('C:\\Users\\lifei\\Desktop')
>>> os.getcwd()
‘C:\\Users\\lifei\\Desktop’