python自帶編譯器在寫入文件時閃退,或者一步步執行到寫入時提示8170。解決辦法:

用python黑框運行程序寫入文件時閃退,或一行行運行到寫入時提示8170數字。python

經試驗,爲文件路徑錯誤致使。spa

with open("1.doc", "wb") as file:
    file.write(response.read())

改成:code

with open("C:\\Users\\用戶名\\Desktop\\1.doc", "wb") as file:
    file.write(response.read())

寫入文件便可成功。blog

但寫入仍是會提示8170的數字,不知爲什麼。it

相關文章
相關標籤/搜索