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