如何在 Python 中获取当前目录
在 Python 中获取当前目录有两种主要方法:
1. 使用 os.getcwd()
import os current_dir = os.getcwd() print(current_dir)
HI,欢迎来到我爱模板网!
如何在 Python 中获取当前目录
在 Python 中获取当前目录有两种主要方法:
1. 使用 os.getcwd()
import os current_dir = os.getcwd() print(current_dir)
(工作日 10:00 - 22:30 为您服务)