compiler-errors

'>=' not supported between instances of 'method' and 'int'

'>=' not supported between instances of 'method' and 'int' Question: Here is the method causing the error: class Kilpailu(): def __init__(self, nimi, pituuskm, osallistujat): self.nimi = nimi self.pituuskm = pituuskm self.osallistujat = osallistujat def kilpailu_ohi(self): for i in self.osallistujat: if (i.getKuljettuMatka>=self.pituuskm): return True else: return False edit: here is also where getKuljettuMatka is defined class …

Total answers: 1

TypeError: Client.__init__() missing 1 required keyword-only argument: 'intents'

TypeError: Client.__init__() missing 1 required keyword-only argument: 'intents' Question: Can somebody assist me here with the error I’m getting? The code: import discord import os from dotenv import load_dotenv from neuralintents import GenericAssistant chatbot = GenericAssistant(‘intents.json’) chatbot.train_model() chatbot.save_model() client = discord.Client() load_dotenv() TOKEN = os.getenv(‘TOKEN’) TOKEN = "my token" @client.event async def on_message(message): if message.author …

Total answers: 1

Error dialects = eval(dialects.strip()) File "<string>", line 0 when try to create exe file in PyInstaller

Error dialects = eval(dialects.strip()) File "<string>", line 0 when try to create exe file in PyInstaller Question: Console error: File "C:UserssemnomeAppDataLocalProgramsPythonPython310libsite-packagesPyInstallerhookshook-sqlalchemy.py", line 31, in <module> dialects = eval(dialects.strip()) File "<string>", line 0 when that happened I usually solved it with: pip install sqlalchemy –upgrade but now it doesn’t work anymore, what do I do? Asked …

Total answers: 2

How to fix the ZeroDivisionError with 1000 decimals digits output in Python?

How to fix the ZeroDivisionError with 1000 decimals digits output in Python? Question: In the following 2 examples: Example 1: from decimal import Decimal, getcontext getcontext().prec = 1000 d = Decimal(1+10**(-24)) 1/d.ln() Example 2: from mpmath import * mp.dps = 1000 mp.pretty=True 1/(ln(1+10**(-24))) I get the ZeroDivisionError. Python 3.7(64-bit) takes it as 1/ln(1) or 1/0. …

Total answers: 1

the output of py command is the same as pip command

the output of py command is the same as pip command Question: when I want to compile my python code, I can’t becose it apparently not the good arguments, Example I have a main.py and I do py main.py and it output an thing that I don’t care about: py main.py WARNING: pip is being …

Total answers: 2

Print the words of the string and their length along the same time

Print the words of the string and their length along the same time Question: Hoping you all to be fit and fine…. I have been trying since a while to get the result of one of the codes that I have written….but unable to get the desired result…Would be more than happy if you could …

Total answers: 4

urllib.error.HTTPError: HTTP Error 403: Forbidden Error

urllib.error.HTTPError: HTTP Error 403: Forbidden Error Question: I was writing code for a project using Python. I was trying to make a project that tells you when your favorite youtuber uploads his/her video when I encountered an error. Here is my code: import time import urllib.request, json def look_for_new_video(): api_key = "AIzaSy…" channel_id = "UCd4QrSA9GDlViP_0dwbdSBA" …

Total answers: 1

how to succesfully compile python 3.x

how to succesfully compile python 3.x Question: Upon attempting to compile python 3.7 I hit Could not import runpy module: jeremyr@b88:$ wget https://www.python.org/ftp/python/3.7.3/Python-3.7.3.tar.xz …. jeremyr@b88:~/Python-3.7.3$ ./configure –enable-optimizations jeremyr@b88:~/Python-3.7.3$ make clean jeremyr@b88:~/Python-3.7.3$ make -j32 …. gcc -pthread -Xlinker -export-dynamic -o Programs/_testembed Programs/_testembed.o libpython3.7m.a -lcrypt -lpthread -ldl -lutil -lm ./python -E -S -m sysconfig –generate-posix-vars ; if …

Total answers: 5