weixin_39736547的博客 'wb') as f: 4 pickle.dump(filenames, f) FileNotFoundError: [Errno 2] No such file or directory: '/tmp/not_exist/filenames.pkl' 您可以通过在写入文件之前确保目录存在来解决此问题:这样做的编程方法是这样...
zhenyu wu的博客student\Desktop\lyric.tx", encoding="utf-8") as file: print(file.read()) >>> FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\shen_student\\Desktop\\lyric.tx' 可见程序报错并中断...