当前位置:   article > 正文

SyntaxError:positional argument follows keyword argument_positional argument follows keyword argument翻译

positional argument follows keyword argument翻译

执行下面的代码时,总是提醒“positional argument follows keyword argument”。

谷歌翻译是:位置参数跟在关键字参数之后。

错误标注在图中所示位置,找了好久才知道原来是打开方式和编码方式前后位置不对。

  1. # 正确写法如下
  2. p = open("1.txt","r",encoding = 'utf-8')
  3. txt = p.read()
  4. print(txt)
  5. p.close()

 

本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号