在Python中,可以使用 os.getcwd() 函数来获取当前工作目录。示例如下:
import oscurrent_directory = os.getcwd()print("Current working directory:", current_directory)运行上面的代码将打印出当前工作目录的路径。
在Python中,可以使用 os.getcwd() 函数来获取当前工作目录。示例如下:
import oscurrent_directory = os.getcwd()print("Current working directory:", current_directory)运行上面的代码将打印出当前工作目录的路径。