如何修复'str'对象在我的python3脚本中没有属性'read'

戴夫

如何修复AttributeError:“ str”对象在python3脚本中没有属性“ read”错误。

user = input("Enter your word : ")
script = open('wordlist.txt', "r")

for s in script:
    content = s.read()
    if user in content:
        print("Match")
    else:
        print("Not match")
劳维

尝试一次检查整个文件

user = input("Enter your word : ")
script = open('wordlist.txt', "r")

if user in script.read():
    print("Match")
else:
    print("Not match")

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

如何修复AttributeError:'str'对象没有属性'_radius'?

来自分类Dev

如何修复python folium geoJSON代码中的“AttributeError:'str'对象没有属性'setdefault'”?

来自分类Dev

AttributeError: 'str' 对象没有属性 'read' Python..

来自分类Dev

如何修复'str'对象在Django中不可调用

来自分类Dev

如何修复错误的“ str”对象没有属性“ relative_url”

来自分类Dev

如何修复 Python 中的“TypeError: 'str' object is not callable”错误?

来自分类Dev

'str'对象在Python3中没有属性'decode'

来自分类Dev

如何修复从PubSub读取并写入BigQuery的数据流管道中的“ AttributeError:'str'对象没有属性'items'”

来自分类Dev

Plist文件解析错误“'str'对象没有属性'read'”

来自分类Dev

如何修复错误“ AttributeError:'模块'对象在python3中没有属性'客户端'?

来自分类Dev

Python连接多个已知扩展名'str'对象的大文件没有属性'read'

来自分类Dev

如何修复python中的“TypeError:必须是str,而不是_io.TextIOWrapper”错误

来自分类Dev

如何配置Atom运行Python3脚本?

来自分类Dev

Python 2-如何修复TypeError:必须为整数(类型为str)

来自分类Dev

如何修复str的重新定义?

来自分类Dev

如何修复“google.cloud.vision”在python3中没有“Client”属性?

来自分类Dev

修复 AttributeError: 'str' 对象没有属性 'HTTP_201_CREATED'

来自分类Dev

无法在Python中修复“ TypeError:'str'对象不可调用”

来自分类Dev

是否有关于如何准备要上传到我的PPA的python3脚本的简单指南?

来自分类Dev

如何在__str__中修复零件,使其在类中显示实例的名称?的Python 2X

来自分类Dev

如何在 Python 中的 tabula.read_pdf() 函数上修复此错误

来自分类Dev

如何修复 [类型错误:+= 不支持的操作数类型:'builtin_function_or_method' 和 'str'] Python 中的错误

来自分类Dev

在DRF(django-rest-framework)中,AttributeError'str'对象没有属性'~~'如何解决?

来自分类Dev

从python3脚本中,如何将字符串传递到bash程序中?

来自分类Dev

如何运行Python 3脚本?

来自分类Dev

“str”对象没有属性“str”

来自分类Dev

如何修复[对象,对象]

来自分类Dev

如何修复脚本?

来自分类Dev

如何修复Bash脚本?

Related 相关文章

  1. 1

    如何修复AttributeError:'str'对象没有属性'_radius'?

  2. 2

    如何修复python folium geoJSON代码中的“AttributeError:'str'对象没有属性'setdefault'”?

  3. 3

    AttributeError: 'str' 对象没有属性 'read' Python..

  4. 4

    如何修复'str'对象在Django中不可调用

  5. 5

    如何修复错误的“ str”对象没有属性“ relative_url”

  6. 6

    如何修复 Python 中的“TypeError: 'str' object is not callable”错误?

  7. 7

    'str'对象在Python3中没有属性'decode'

  8. 8

    如何修复从PubSub读取并写入BigQuery的数据流管道中的“ AttributeError:'str'对象没有属性'items'”

  9. 9

    Plist文件解析错误“'str'对象没有属性'read'”

  10. 10

    如何修复错误“ AttributeError:'模块'对象在python3中没有属性'客户端'?

  11. 11

    Python连接多个已知扩展名'str'对象的大文件没有属性'read'

  12. 12

    如何修复python中的“TypeError:必须是str,而不是_io.TextIOWrapper”错误

  13. 13

    如何配置Atom运行Python3脚本?

  14. 14

    Python 2-如何修复TypeError:必须为整数(类型为str)

  15. 15

    如何修复str的重新定义?

  16. 16

    如何修复“google.cloud.vision”在python3中没有“Client”属性?

  17. 17

    修复 AttributeError: 'str' 对象没有属性 'HTTP_201_CREATED'

  18. 18

    无法在Python中修复“ TypeError:'str'对象不可调用”

  19. 19

    是否有关于如何准备要上传到我的PPA的python3脚本的简单指南?

  20. 20

    如何在__str__中修复零件,使其在类中显示实例的名称?的Python 2X

  21. 21

    如何在 Python 中的 tabula.read_pdf() 函数上修复此错误

  22. 22

    如何修复 [类型错误:+= 不支持的操作数类型:'builtin_function_or_method' 和 'str'] Python 中的错误

  23. 23

    在DRF(django-rest-framework)中,AttributeError'str'对象没有属性'~~'如何解决?

  24. 24

    从python3脚本中,如何将字符串传递到bash程序中?

  25. 25

    如何运行Python 3脚本?

  26. 26

    “str”对象没有属性“str”

  27. 27

    如何修复[对象,对象]

  28. 28

    如何修复脚本?

  29. 29

    如何修复Bash脚本?

热门标签

归档