质量为本、客户为根、勇于拼搏、务实创新
python中getcwd函数怎样使用
在Python中,可使用os模块中的getcwd()函数来获得当前工作目录。getcwd()函数不需要任何参数。示例以下:
os
getcwd()
import os # 获得当前工作目录 current_dir = os.getcwd() print("当前工作目录:", current_dir)
输出结果为当前工作目录的路径。
TOP