如何在Python中知道当前工作目录? 要知道当前工作目录或pwd,请使用os模块。 阅读更多:Python 教程 例如 >>> import os >>> print(os.getcwd()) /home/ayush/qna