摘要:
import os # 获取当前工作目录 current_dir = os.getcwd() print(f"当前工作目录: {current_dir}") # 更改当前工作目录到指定路径 new_dir = "/path/to/your/directory" os.chdir(new_dir) # 阅读全文
摘要:
import os file_path = "C:\\path\\to\\your\\file_or_directory" os.startfile(file_path) 阅读全文