Category "python"

TypeError: argument of type 'Message' is not iterable. Discord Python Bot

I get this error everytime a message is sent ive tried looking for solutions but havent found any here is the traceback: Traceback (most recent call last): Fi

Two HTML Forms in one DJango views

I have two simple HTML forms on one page. I want to create Django view to submit multiple Django forms. I can submit form1 but I have no clue how to submit form

Any short way to create a combinations of arrays with fixed length and sum?

For example: array = [4,0,0] The generated arrays have to be of a fixed length and sum of the array has to be also fixed. What would be the shortest and effici

Why do rebound methods of PyQt classes raise a TypeError

Making my code compatible with PyQt5/6 and PySide2/6, I wrote if not hasattr(QtCore.QDateTime, 'toPython'): # fix for PyQt5/6 QtCore.QDateTime.toPython = Q

Odd JS Errors when using QWebEnginePage

So I've been working on an authentication system using PyQt6-WebEngine to make web requests that will follow javascript redirects since Requests in Python doesn

Why does my data come from request.form when passing it to the backend in Flask, python?

I've been trying to figure out the best way to pass data from frontend to backend in Flask. The problem is that when receiving data on the back end, the data re

Python: round(random.uniform) printing wrong float value on output console but in background its correct value

See the following code import re import random s = "~|21|050000|voltage|current|ApparentPower|12345~" for _ in range(100): vol_val = round(random.uniform(23

can dolphinscheduler run a sql script or a python script file?

Can I upload sql scripts or python scripts, and run them in a process? I can only write sql statements in SQL tool, but I have some .sql files that should be ex

How to find different items between mulitiple lists

I am trying to figure out how to compare n lists to find the different items. For example, consider the list: list_l = [[1,2,3,4,5,100], [1,2,31,41,

Python: add days to date without any modules

I wonder is there any simple and elegant way to add days to date in python without using any modules. Imaging we have code like this: from datetime import date,

asyncio whether to support tracking lines to a specific timeout

I want to trace the line where asyncio times out eg :await asyncio.sleep(100000) import asyncio async def eternity(): await asyncio.sleep(1) print('yay

Avoid interpolating over constraints

Hi I am in the process of interpolating data, but the data from N. America, for example, affect the data from Europe (see figure). I have found out that I must

How to print p variable inside ipdb

I have variable called p and I want to print its value inside ipdb. p = 100 breakpoint() # DEBUG ipdb> help p p expression Print the value of the e

Why do I get different output depending on whether I enter the values manually or read a CSV file with exactly the same values?

I'm trying to plot the fall of an object (an optical fork to be precise) as a function of time in order to verify that the law of gravity is indeed 9.81. The di

communicating with serial virtual COM port using python

I have written snippet below to communicate (send a simple '1' character) with serial virtual COM3 port, which is connected to a STM32 board, using python. But

Why does on_member_join() is not working in my discord.py bot? [duplicate]

I try to run this code below, but on_member_join is not working for me. async def on_member_join(self, member): guild = member.gui

Export HANA SQL query or table in CSV

I use a HANA 2.0 database. I want to export a table or a sql query from the database to an external client as fast as possible and using a command line (i'm on

Storing and using GUI objects with Tkinter

So I have a class that just creates a gui with a text box to type into. I would like to store multiple of these objects and their content that is entered by the

How to create a table inside a table cell in reportlab

I am in a situation where I need to create a table inside the table cell, which is the description field in the data which will be a list itself. I need to make

i want to scrape another class if first class is not found (n/a) in beautifulsoup, how to code this?

I'm scraping Indiegogo to see how many backers there are. However, because there are two different formats, it first scrapes the content for the first layout, b