错误是由于从os模块引入了所有的函数导致的,os模块下有一个open函数,接受整型的文件描述符和打开模式,from os import *引入os模块的open函数,覆盖了python内建的open函数,导致错误。
删除from os import *这行,然后再根据需要,指定引入os模块下的函数

建议任何时候都不要使用from module import *方式引入模块函数。

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-14
  • 2022-01-10
  • 2021-06-27
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-04-19
  • 2021-10-20
相关资源
相似解决方案