温馨提示×

python getcwd函数如何获取当前工作目录

小樊
82
2024-08-26 15:35:11
栏目: 编程语言

要获取当前工作目录,可以使用Python中的os模块中的getcwd()函数。示例如下:

import os

current_dir = os.getcwd()
print("Current working directory:", current_dir)

运行上述代码,将输出当前工作目录的路径。

0