有没有办法在不关闭Python的情况下移动文件?
我有一个程序,可以制作微积分,转换不同的数据并绘制它们,同时将其保存在不同的目录中。到目前为止,一切都很好。每当我想将生成的文件移动到另一个文件夹而不关闭Python时,就不允许我与其中一个一起,告诉我一个程序仍然可以打开它,我无法移动它。怪异的部分是我可以取出生成的所有图,因此文件夹本身无法移动。我不知道该怎么办,因为其他文件夹是以相同的方式生成和处理的,不要给我问题。有什么想法吗?
tl; dr:在python仍然打开时无法移动空文件夹
path_data_anaconv = path_data + r'TheProblem/'
if not os.path.exists(path_data_anaconv):
os.makedirs(path_data_anaconv)
I have a program that makes calculus, converts different data and plots it while saving it in different directories. So far, so good BUT. Whenever I want to move the files generated to another folder without closing Python it doesn't let me only with one of them, telling me that a program still has it open and I can't move it. The weird part is that I can take out all the plots generated so it's the folder itself that can't be moved. I don't know what to do because other folders are generated and treated the same way and don't give me problems. Any idea?
TL;DR: Can't move a empty folder while Python is still open
path_data_anaconv = path_data + r'TheProblem/'
if not os.path.exists(path_data_anaconv):
os.makedirs(path_data_anaconv)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论