This question already has an answer here:
In Python, what commands can I use to find:
- the current directory (where I was in the terminal when I ran the Python script), and
- where the file I am executing is?
</div>
转载于:https://stackoverflow.com/questions/5137497/find-current-directory-and-files-directory