📜  获取当前目录python代码示例

📅  最后修改于: 2022-03-11 14:47:16.288000             🧑  作者: Mango

代码示例6
import os
current_working_directory = os.getcwd()
print(current_working_directory) # should print the cwd

""" Bonus: If you want to change cwd, without moving file,
use the following method"""
os.chdir("path/to/directory")