The problem is in your playerMovement method. You are creating the string name of your room variables (ID1, ID2, ID3):

letsago = "ID" + str(self.dirDesc.values())

However, what you create is just a str. It is not the variable. Plus, I do not think it is doing what you think its doing:

>>>str({'a':1}.values())
'dict_values([1])'

If you REALLY needed to find the variable this way, you could use the eval function:

>>>foo = 'Hello World!'
>>>eval('foo')
'Hello World!'

or the globals function:

class Foo(object):
    def __init__(self):
        super(Foo, self).__init__()
    def test(self, name):
        print(globals()[name])

foo = Foo()
bar = 'Hello World!'
foo.text('bar')

However, instead I would strongly recommend you rethink you class(es). Your userInterface class is essentially a Room. It shouldn't handle player movement. This should be within another class, maybe GameManager or something like that.

Answer from BeetDemGuise on Stack Overflow
🌐
Esri Community
community.esri.com › t5 › arcgis-api-for-python-questions › str-object-has-no-attribute › td-p › 1053478
Solved: 'str' object has no attribute - Esri Community
September 14, 2021 - The clone_items function takes a list of Items. It seems like you are passing in the string item ids instead.
🌐
Stack Overflow
stackoverflow.com › questions › 73009246 › why-do-i-get-the-error-str-object-has-no-attribute-head
python - Why do I get the error 'str' object has no attribute 'head'? - Stack Overflow
As it is, self will be the first thing passed to the function, which in this case is the string "_", hence the error. ... Alternatively, maybe you wanted to instantiate the interface with tp().comp(...). But it's not clear since this isn't a reproducible example. ... Print self and find out. ... It appears I have forgotten the basics of how self works, lol. Thanks for the quick replies! ... class comp: def __init__(self, head, headLeft, headRight, border, outer, user, folders, size): self.head = head self.headLeft = headLeft self.headRight = headRight self.border = border self.outer = outer self.user = user def test(self): print(self.head)
Discussions

python - AttributeError: 'str' object has no attribute 'head' - Stack Overflow
That is assuming the result of sns.load_dataset has a head member function ... Nevermind, please disregard the previous comment regarding the TypeError: 'str' object is not callable. I rebooted the Visual Studio Code IDE and that apparently fixed the error. More on stackoverflow.com
🌐 stackoverflow.com
python - AttributeError: 'str' object has no attribute - Stack Overflow
I'm pretty new to python programming and I wanted to try my hand at a simple text adventure game, but I've immediately stumbled on a roadblock. class userInterface: def __init__(self, roomID, More on stackoverflow.com
🌐 stackoverflow.com
How do i fix this : AttributeError: 'str' object has no attribute 'current'
It says AttributeError: 'str' object has no attribute 'current'. That error isn't coming from this function. More on reddit.com
🌐 r/learnpython
11
0
December 7, 2023
AttributeError: 'str' object has no attribute 'get'
The formatting of your post is hella weird - how about you just include a link to your replit · For the catplot, you need to add a line fig=fig.fig before saving - as the test is not designed for standard object sns is returning · Am sorry for my formatting errors Jagaya, am new to this . More on forum.freecodecamp.org
🌐 forum.freecodecamp.org
0
0
December 2, 2021
🌐
Quora
quora.com › What-can-I-do-if-I-have-attribute-error-str-object-has-no-attribute-re
What can I do if I have attribute error: 'str' object has no attribute 're'? - Quora
Answer: Work out what object should have that re attribute and why your code is using a string not the correct object. In my experience these type of errors tend to happen because of misleading variable names: if your variables are all using single letter etc. It is easy to get confused as to wh...
🌐
Stack Overflow
stackoverflow.com › questions › 76724198 › attributeerror-str-object-has-no-attribute-head
python - AttributeError: 'str' object has no attribute 'head' - Stack Overflow
Remove the =; it assigns values to the functions instead of calling them this renders them useless and they are just strings -> hence the error. ... import seaborn as sns tips = sns.load_dataset('tips') flights = sns.load_dataset('flights') tips.head()
🌐
Bobby Hadz
bobbyhadz.com › blog › python-attributeerror-str-object-has-no-attribute
AttributeError: 'str' object has no attribute 'X in Python | bobbyhadz
April 8, 2024 - The Python AttributeError: 'str' object has no attribute occurs when we try to access an attribute that doesn't exist on string objects.
🌐
Brainly
brainly.com › engineering › college › what does "str object has no attribute" mean in python?
[FREE] What does "str object has no attribute" mean in Python? - brainly.com
In Python, the error message "AttributeError: 'str' object has no attribute" indicates that you are trying to access a method or attribute that does not exist for string objects.
Find elsewhere
🌐
Reddit
reddit.com › r/learnpython › how do i fix this : attributeerror: 'str' object has no attribute 'current'
r/learnpython on Reddit: How do i fix this : AttributeError: 'str' object has no attribute 'current'
December 7, 2023 -

There is something wrong with this function. It shows no errors, but when I try to run it, It says AttributeError: 'str' object has no attribute 'current'. (BTW, i am trying to run it as a flet on spyder)

def leapyears(e):

days_in_month = {1: 31, 3: 31, 4: 30, 5:31, 6: 30, 7: 31, 8: 31, 9: 30, 10: 31, 11: 30, 12: 31 }

month = int(EnterMonth_text.value)

year = int(EnterYear_text.value)

if year % 100 == 0:

if year % 400 == 0:

leap_year = True

elif year % 4 == 0:

leap_year = True

else:

leap_year = False

if month == 2 :

if leap_year:

days_in_month[2] = 29

else:

days_in_month[2]= 28

output_textfield.value= days_in_month[month]

page.update()

🌐
freeCodeCamp
forum.freecodecamp.org › python
AttributeError: 'str' object has no attribute 'get' - Python - The freeCodeCamp Forum
December 2, 2021 - The formatting of your post is hella weird - how about you just include a link to your replit · For the catplot, you need to add a line fig=fig.fig before saving - as the test is not designed for standard object sns is returning · Am sorry for my formatting errors Jagaya, am new to this .
🌐
Itsourcecode
itsourcecode.com › home › attributeerror: ‘str’ object has no attribute ‘str’ [solved]
Attributeerror: 'str' object has no attribute 'str' [Solved]
April 5, 2023 - However, you can perform various ... ‘str’ object has no attribute ‘str’ means that you are trying to call the “str” attribute or method on a string object....
🌐
Reddit
reddit.com › r/learnpython › 'str' object has no attribute error?
r/learnpython on Reddit: 'Str' object has no attribute error?
November 9, 2023 -

I have some experience with programming in Java, C++, etc. and I am trying to write a simple "To-Do List" program to get used to Python. I'm running into the error: str object has no attribute "completed" when trying to iterate over the list of tasks, check their completion status, and display them.

Here are some relevant pieces of the program:

Constructor for the Task class

def __init__(self, task_name):

self.task_name = task_name

self.completed = False

In the ToDoList class (which holds a list of the task instances created by the user) this is the iteration throwing the error in question:

for idx, task in enumerate(self.tasks, start=1):

status = "Completed" if task.completed else "Incomplete"

print(f"{idx}. {task.task_name} - {status}")

I thought, potentially the problem lies in the fact that the enumerate function is grabbing the string value of the task instance, rather than the object itself, so maybe I can iterate over it the old fashioned way and get around it. So I tried it like this:

counter = 1

for task in self.tasks:

status = "Completed" if task.completed else "Incomplete"

print(f"{counter}. {task.task_name} - {status}")

counter += 1

Yet, it throws the same error. I know there is something I am missing or not understanding correctly here. What is it?

Thanks!

🌐
Fast.ai
forums.fast.ai › part 1 (2019)
AttributeError: 'str' object has no attribute 'paragraphs' - Part 1 (2019) - fast.ai Course Forums
December 2, 2020 - Hello. I am trying to create a language model from blogs. I am calling the Datasets API to build a language model from blogs. dsets = Datasets(df_p, [tfms],dl_type=LMDataLoader) df_p is a pandas dataframe that contains blogs. When we print: print(df_p.head()) Result is: 0 ['12 years ago, the smartphone was in its infancy.
🌐
Ucsb
discover.cs.ucsb.edu › commonerrors › error › 1001.xml
1001.xml
Python has a lot of built in functions that are used in place of common object attributes in other languages. ... Traceback (most recent call last): File "helloworld.py", line 5, in module main() File "helloworld.py", line 3, in main print foo.length() AttributeError: 'str' object has no attribute 'length'
🌐
Quora
quora.com › How-do-you-resolve-attributeerror-str-object-has-no-attribute-variables-Python-solutions
How to resolve 'attributeerror: 'str' object has no attribute 'variables'' (Python, solutions) - Quora
Fix the source of the string—load, instantiate, or look up the actual object—and avoid name shadowing so .variables is called on the correct type. ... RelatedHow do you resolve "attributeerror: 'dataframe' object has no attribute 'reshape'" (Python, Python 3.x, machine learning, deep learning, LSTM, development)?
🌐
Edureka Community
edureka.co › home › community › categories › others › error attributeerror str object has no...
Error AttributeError str object has no attribute row | Edureka Community
April 4, 2023 - I have code: def add_to_database(object_name, value): workbook = openpyxl.load_workbook(DATABASE_FILE) worksheet ... row, column = 2).value += value
🌐
Quora
quora.com › How-do-I-resolve-the-AttributeError-‘Str’-object-has-no-attribute-‘update’-in-Python
How to resolve the AttributeError: ‘Str’ object has no attribute ‘update’ in Python - Quora
Answer: A2A. So, in Python there are certain in built methods which you can directly use. Example: [code]L = [1, 2, 3] L.append(4) L.pop() L.insert(0, 10) [/code]And likewise many others. Similarly, strings have separate set of available built-in methods. [code]s="python" s.isdigit() s.islower...
🌐
Tryton
discuss.tryton.org › support › developer
How i can resolve error "AttributeError: 'str' object has no attribute 'strftime'" and "TranslateModel object has no member named..." - Developer - Tryton Discussion
March 1, 2022 - Hi i would like to generate a printout after work with the wizard “credit”, I have remarked that the date of the invoice change automatically to today date(default_date) , But what i want in my printout that i would generated is display the origin date of the invoice that I have made already ...
🌐
GeeksforGeeks
geeksforgeeks.org › python › how-to-fix-attributeerror-object-has-no-attribute
How to fix AttributeError: object has no attribute - GeeksforGeeks
July 23, 2025 - To understand this error, we first have to know how to read the error message effectively. It typically consists of two parts: "AttributeError" and "Object has no attribute." The former indicates the type of error, and the latter suggests that the attribute we are trying to access does not exist for the object.