python获取当前目录的方法是什么

在 Python 中,你可以使用 `os` 模块来获取当前工作目录。以下是获取当前目录的方法:

```python

import os

current_directory = os.getcwd()

print("Current directory:", current_directory)

```

这段代码将打印出当前 Python 脚本所在的目录路径。

阅读剩余
THE END