python自带编译器在写入文件时闪退,或者一步步执行到写入时提示8170。解决办法:
用python黑框运行程序写入文件时闪退,或一行行运行到写入时提示8170数字。
经试验,为文件路径错误导致。
SRE实战 互联网时代守护先锋,助力企业售后服务体系运筹帷幄!一键直达领取阿里云限量特价优惠。with open("1.doc", "wb") as file: file.write(response.read())
改为:
with open("C:\\Users\\用户名\\Desktop\\1.doc", "wb") as file: file.write(response.read())
写入文件即可成功。
但写入还是会提示8170的数字,不知为何。

更多精彩