摘要: import os # 获取当前工作目录 current_dir = os.getcwd() print(f"当前工作目录: {current_dir}") # 更改当前工作目录到指定路径 new_dir = "/path/to/your/directory" os.chdir(new_dir) # 阅读全文
posted @ 2024-01-20 16:22 zwnsyw 阅读(93) 评论(0) 推荐(0) 编辑
摘要: import os file_path = "C:\\path\\to\\your\\file_or_directory" os.startfile(file_path) 阅读全文
posted @ 2024-01-20 15:29 zwnsyw 阅读(176) 评论(0) 推荐(0) 编辑