Category "python"

Function not executing in telethon

If I start the client at the beginning of the script api_id = 123254534 api_hash = '124324235543' client = TelegramClient('parslon', api_id, api_hash) client.st

Check if number should be C++ float or C++ double using python

I am working on a simple C++ code generator created by excel parsing and I will need to distinguish between number type. I can deduce integer size (e.g. uint_32

Django CreateView object.id in get_succes_url pk(id) is NONE and then after redirecting to another URL it prints out created entry ID

I have a problem that I just can't figure out. After creating a work order I want to redirect to the detail page of that work order. Here is my models.py class

Can't access DataFrame elements after reading from CSV

I'm creating a matrix and converting it into DataFrame after creation. Since I'm working with lots of data and it takes a while for creation I wanted to store t

how to solve this errorss?egg_info?

Collecting playsound Using cached playsound-1.3.0.tar.gz (7.7 kB) Preparing metadata (setup.py) ... error error: subprocess-exited-with-error × p

my kivy app is all right on my computer, but don't show its content on my phone

My kivy project can run correctly on my computer, but if I use package logging to log, the project will not start application main loop on my phone. The followi

How to store data into a model associated with the current user?

In my frontend i'm logging into another app's api in the browser, I'm then redirected back to my app, that hits a View in my backend which gets a code from the

How to resolve the following error in discord.py: "TypeError BotBase.__init__() missing one keyword-only argument: 'intents'"

I am using the following code to run my discord bot: bot=commands.Bot(command_prefix="!") However, when trying to run it in vscode, I get the following error:

OpenCV warpAffine error during image augmentation using Albumentations

I have been trying to do image augmentation using a library called Albumentations. But I got some error from OpenCV while transforming the images. I ran the cod

Pygame installing but not running

I've uninstalled and reinstalled pygame multiple times using pip3 install pygame and it installs fine, but when I try to import it, it gives me a ModuleNotFound

how can I loop through search function - python

I am trying to make search program but I stuck in some loop part. There are several steps for function works. First, I will get a word(input) from users. Then,

Why win32com doesnt show me all emails

I want to parse emails in python through the Outlook application. Running this code I get only a few of my emails. import win32com.client outlook = win32com.cli

Why doesn't python3's print statement flush output when end keyword is specified?

from sys import argv, stdout as cout from time import sleep as sl print("Rewinding.......",end = '') # If end is given output isn't flushed. But why? cout.flush

Using numpy.where function with multiple conditions but getting valueError

So I have a dataframe with multiple columns with numbers in them. It looks like this: H C T P R 300 200 500 0.3 500 400 300 0.2 I'm trying to perform operat

How to Scrape Discord members using Python?

I am trying to scrape members of a Discord server. This is code I am using. But I am running into KeyError: 'guilds'. Can anyone please help me with this? impor

3d model looks inside out or distorted outside and perfect inside (VULKAN)

Any 3d model loaded into my vulkan code is perfect inside and wrong outside.How can I make outer surface look like inner surface? It is like the same in 3d mode

How to display existing annotations in dcc.Graph

I'm working on a tool that loads some of my precomputed annotations in the form of bboxes = [ ((x0, y0), (x1, y1)), # annot 1 ... # more

Date interval average Python pandas

This is my dataframe: ID number Date purchase 1 2022-05-01 1 2021-03-03 1 2020-01-03 2 2019-01-03 2 2018-01-03 I want to get a horizontal dataframe with alle

porting PIL python 2.x to pillow python3.10

I am trying to port an old library from python 2.x which uses PIL to Python 3.10 with PILLOW. right now I am stuck the old library uses the fromstring command:

Python Dictionary: How to get the longest key for the longest value?

dic = {'a':4, 'b':5, 'cd':5 } I'm trying to find: highest value (search for the highest value first => b, cd) longest key (then search for the longest key