阅读量:125
要获取当前工作目录,可以使用Python中的os模块中的getcwd()函数。示例如下:
import os
current_dir = os.getcwd()
print("Current working directory:", current_dir)
运行上述代码,将输出当前工作目录的路径。
要获取当前工作目录,可以使用Python中的os模块中的getcwd()函数。示例如下:
import os
current_dir = os.getcwd()
print("Current working directory:", current_dir)
运行上述代码,将输出当前工作目录的路径。