I need to find the default "Document" directory path using programmatically using pyhon
import os
print(os.getcwd())
I am able to access the current directory by using above code. How do I get the default "Document
" directory.
I need to find the default "Document" directory path using programmatically using pyhon
import os
print(os.getcwd())
I am able to access the current directory by using above code. How do I get the default "Document
" directory.
os.path.expanduser("~/Documents")
This should be able to achieve what you looking for.
For more documentation , you can refer to https://docs.python.org/2/library/os.path.html.