Category "python-3.x"

Issues with IPython magics [TerminalIPythonApp] WARNING unrecognised alias

I recently got my code to function and was so proud of myself for figuring out the challenges experienced then. However, I reviewed some stuff in connecting wit

Make codes run for each individual

Is it possible to listen to each users contract events from the database at once? I've tried but it only works for one user. Web3 python telebot from web3 impor

Python: How to use the "win32com" event-class-method-execution within a script (Excel-Button-click)

In reference to this post Excel button click event in Python I want to not only print out a message to the console, but instead call a function or change a vari

What is the purpose of sort_index of a Dataclass in Python?

I am learning about Dataclasses but I am confused on the purpose of sort_index and how it actually works. I can't seem to find any valuable information on it. T

Collect coins from the map in Pygame

I'm trying to make a pygame game but I'm having a problem. I want when a character collects a coin, the score will change by one and the coin will disappear. I

I want to update my SQLite3 database fields in Python tkinter and I'm getting errors

I'm trying to update the firstname field in my SQLite3 database, I tried using exception to get this error but couldn't still fix it. This is the code: conne =

Make codes run at once for all users

Is it possible to listen to each users contract events from the database at once I've tried but it only works for one user.. Helps will be appreciated Web3 pyth

Don't understand how to code the condition [duplicate]

There are no errors in this but I can't understand how to code the condition. If I change the condition to if money != string.digits: and run

Shortest path without given nodes

so I was given x amount of points generated randomly and need to find the shortest path for all of those points. So what would be the best method I could use gi

UnboundLocalError: local variable <function> referenced before assignment

I have read similar questions on this topic such as from here, here, and here, and others on scope, but I still cannot understand why answers do not explain the

UnboundLocalError: local variable <function> referenced before assignment

I have read similar questions on this topic such as from here, here, and here, and others on scope, but I still cannot understand why answers do not explain the

Character problem with endpoint '/{GROUP_ID}/feed' of Facebook API

The code below works without error, but the posted text is cut off in Facebook as soon as a "&" character is found. TOKEN_ID = '<Token>' GROUP_ID = '&

Windows and Linux file path issues using python SQL load data infile

I am working on a mysql (8) db which is too big for the 2TB linux partition size so I have moved the mysql instance onto a 16TB nvme raid under windows 10. All

How replace all these "if...elif...else" statements with something more concise?

Is there a way to reduce the amount of elif things in my statement? In another question I asked someone said that my code suffered from redundancy and it defini

Convert dog ages to human years

it as been a long time without programming. I'm doing a function that converts the age of a dog to human years, but I'm getting some mistakes and I am not getti

Trying to install python-mbedtls on Windows using VSCode

I am trying to install the python-mbedtls package using pip installer in my venv on Windows, but I am getting the below error: build\3.10.2\temp.win-amd64-3.10\

Can't load custom pylint module

I am following a simple tutorial that creates a custom checker/module for Pylint. The code looks like this. bad_code.py def func(): print("Bad code") r

Can't remove backslash from string in Python

I want to remove backslash from a string, I tried result.replace('\\','') but nothing changed. Anyone has an idea how I can remove it? result = '[(\'company_ids

How to use the least_square function from Scipy

I am trying to understand how the least_square function works. I have checked the documentation and the following link (example least_sqr) which gives me a step

Python environment or installation doesn't have the spyder-kernels module or the right version of it installed

I've tried several of the other suggestions/answers on this exact topic. I used Spyder-kernel 2.0.5 with Spyder 5.0.5 with Python 3.9.6. The env activation proc