繁体   English   中英

Python - 该进程无法访问该文件,因为它正被另一个进程使用:

[英]Python - The process cannot access the file because it is being used by another process:

我制作了一个脚本来将 excel 文件从源目录移动到特定目录。 该脚本有效,但我在 VSCode 终端中收到一条错误消息:

[WinError 32] The process cannot access the file because it is being used by another process:
File "C:\Users\aizat\OneDrive - PKT LOGISTICS (M) SDN BHD\Desktop\Python Test\Jabil-Inbound.py", line 195, in <module>
        shutil.move(source_dir+file_name,target_dir)

附加链接是我在 python https://pastebin.com/RSkHLSuU中的编码

尝试在第 140 行将 writer.save() 替换为 writer.close()

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM