2024-09-28 19:26:29 发布
网友
我知道我可以用操作系统模块创建一个新目录。但我试图用subprocess模块创建一个新目录,如下所示:
p=subprocess.Popen("mkdir extractions", shell=True) os.chdir("extractions")
当脚本执行时,我注意到目录extractions已创建,但下一个os.chdir调用失败,说明目录extractions不存在。我知道我在使用子流程时遗漏了一些东西,这使得下一行不知道创建的目录。请帮忙!
目前没有回答
目前没有回答
相关问题 更多 >
编程相关推荐