attributeerror

AttributeError: 'list' object has no attribute 'strip

AttributeError: 'list' object has no attribute 'strip Question: I cant figure out why this isnt working and just throwing me an error. I tried to move some things areounf and its still not working. It has to be something about it not reading to the list or something like that. from Country import Country import …

Total answers: 1

NoneType erorr when calling .lower() method on annotated text

NoneType erorr when calling .lower() method on annotated text Question: I have annotated articles in a list (len=488), and I want to apply the .lower() method on the lemmas. I get the following error message AttributeError: ‘NoneType’ object has no attribute ‘lower’. Here’s the code: file = open("Guardian_Syria_text.csv", mode="r", encoding=’utf-8-sig’) data = list(csv.reader(file, delimiter=",")) file.close …

Total answers: 1

Is there a way to play audio without calling the connect command? (pycord)

Is there a way to play audio without calling the connect command? (pycord) Question: In my implementation whenever I call the play method while the bot is connected to the voice channel, it will throw an error. However, the official documentation, including other videos on the matter, use the same method. The main reason I …

Total answers: 1

'float' object has no attribute 'insert'

'float' object has no attribute 'insert' Question: a = [5, -2.5, 3, 4, 12, 17] v = [] b = 0 c = 1 for i in a: if i>0: b = b + 1 print(i, end=" ") elif i<0: v.insert(i) print(v.sum()) i.insert(v) AttributeError: ‘float’ object has no attribute ‘insert’                                 . Asked By: g0lnad || …

Total answers: 1

Pillow raises error: "AttributeError: read" when attempting to use Image.Open for ImageTk

Pillow raises error: "AttributeError: read" when attempting to use Image.Open for ImageTk Question: I am attempting to create a paint program but in my open() function, it raises this error: Exception in Tkinter callback Traceback (most recent call last): File "C:Program FilesWindowsAppsPythonSoftwareFoundation.Python.3.10_3.10.2288.0_x64__qbz5n2kfra8p0libtkinter__init__.py", line 1921, in __call__ return self.func(*args) File "C:Users——-PycharmProjectsPaintmain.py", line 31, in open canvas.create_image(0, …

Total answers: 1

Python: AttributeError: module 'core' has no attribute 'children'

Python: AttributeError: module 'core' has no attribute 'children' Question: Hello I’m working on mobile application with kivy and python. Everything was fine until I wanted to use sqlite3. Here is my directory structure: application ├───main.py ├───core │ └───__pycache__ | ├───calendar_screen.py | ├───children.py | ├───menu.py | ├───screen_manager.py | ├───settings.py | └───vaccination.py ├───database | ├───vaccination_calendar.db | ├───vaccination_calendar.py …

Total answers: 2

Getting an AttributeError: 'Update' object has no attribute 'send_message' when I try to send a message with Telegram bot

Getting an AttributeError: 'Update' object has no attribute 'send_message' when I try to send a message with Telegram bot Question: Im getting an AttributeError: ‘Update’ object has no attribute ‘send_message’ when I try to send a message. And I know that ‘Update’ class does not have a ‘send_message’ attribute but Im not using the ‘Update’ …

Total answers: 1

AttributeError: 'NoneType' object has no attribute 'text'

AttributeError: 'NoneType' object has no attribute 'text' Question: article_content = [] for url in li: response = requests.get(url) soup = BeautifulSoup(response.text, "html.parser") article_content.append(soup.find("div", {"class": "article-content"}).text) gives the error: AttributeError Traceback (most recent call last) Cell In[19], line 5 3 response = requests.get(url) 4 soup = BeautifulSoup(response.text, "html.parser") —-> 5 article_content.append(soup.find("div", {"class": "article-content"}).text) AttributeError: ‘NoneType’ object …

Total answers: 1

Unable to loop correctly

Unable to loop correctly Question: I am working on assignment to extract emails from the mailbox. Below are my codes, I am referencing from this case and combine with some other research online: import win32com.client import pandas as pd import os outlook = win32com.client.Dispatch("Outlook.Aplication").GetNamespace("MAPI") inbox = outlook.GetDefaultFolder(6).Folders["Testmails"] condition = pd.read_excel(r"C:UsersAsusDesktopPythonCondition.xlsx", sheet_name = ‘endword’) emails = …

Total answers: 2