13.02.2019 · AttributeError: 'str' object has no attribute 'author' 1 (discord.py) How do I get my bot to read DM's that are sent to it and either print them or send them to a specific channel
Solution 3. The python variable should be checked for the list. if the variable is of type list, then call the append method. Otherwise, take the alternative path and ignore the append () attribute. The example below will show how to check the type of the variable and how to call append method.
The second rule is that no identifier can have the same name as one of Python's ... function called dir() that returns a list of an object's attributes.
Python: AttributeError: 'str' object has no attribute 'text'. This question shows research effort; it is useful and clear. -2. This question does not show any research effort; it is unclear or not useful. Bookmark this question.
Why myList[1] is considered a 'str' object? Because it is a string. What else is 'from form', if not a string?(Actually, strings are sequences too, i.e. they can be indexed, sliced, iterated, etc. as well - but that's part of the str class and doesn't make it a list or something).. mList[1] returns the first item in the list 'from form' If you mean that myList is 'from form', no it's not!!!
Use a StringVar not a str def createWidgets(self, master=None): var = tk.StringVar(). A python str has no set method or attribute, a StringVar is specific ...