Quantcast
Channel: Active questions tagged python - Stack Overflow
Browsing all 23160 articles
Browse latest View live
↧

Method for detecting an auto page break - pyfpdf

I am designing a tool to display a git repository's commits in PDF form with pyfpdf.It have designed it so that each commit only spans across one page if possible. However, if a commit is longer than a...

View Article


Peek of multiprocessing.queue?

I have multiple worker processes reading from the same multiprocessing.queue(). Each worker process only read contents belongs to itself, and must leave the other contents untouched. So basically the...

View Article


Why am I getting an error loading a specific module(torch)?

Traceback (most recent call last): File "c:\Users\Admin\OneDrive\Desktop\Python\OpenCV\t.py", line 2, in <module> import torch File...

View Article

Topaz signature with Python

I'm going to the python project with Topaz signature.We make the GUI including 2 buttons (write, save) with python.When click the write btn, then sign the Topaz.When click the save btn, then the...

View Article

Socketio background task not running

I am creating a multiplayer online game, and am using socket io for the game server. Below is my server codeimport socketioimport timefrom aiohttp import websio =...

View Article


How do I keep a correct API spec when using a ModelSerializer?

I'm using a model serializer to serialize a list as a dictionary (thanks to Plagon). This however leaves me with an incorrect API spec.How do I ensure the API spec is correct?from uuid import UUID,...

View Article

How to match a string not surrounded by brackets and parenthesis using regex

I have a collection of strings that take, for example, the following form:(GOOGL) [ST]S (partial) 02/01/2024 03/01/2024 $1,001 - $15,000(PHG) [ST]P 02/12/2024 03/01/2024 $1,001 - $15,000(PFE) [ST] P...

View Article

How to monitor reactions to Telegram messages via pyTelegramBotAPI?

I want to use pyTelegramBotAPI (or any other non-async Python library) for a bot that has to monitor messages in a chat and to reply to messages that got a reaction.For example, in 2 hours after I sent...

View Article


How is the address of an Base Chain contract computed?

I'm curious when i see some fantastic projects, so I'm doing some experiments to find out the method which used by Base to generate the contract address.Tried with two different methods, and I've...

View Article


Image may be NSFW.
Clik here to view.

How to scrape table into dataframe with selenium / requests / beautifulsoup?

My objective is that for website https://data.eastmoney.com/executive/000001.html, when you scroll down you will find a big tableand I want to turn it into a DataFrame in Python. Is BeautifulSoup...

View Article

flask session is expiring when i am redirection to a another server domain...

def generate_url(): if request.method == "POST": try: session.permanent = True review_payment.permanent_session_lifetime = timedelta(minutes=30)i am generating an url in this function and redirecting...

View Article

How to get backslash in list comprehension

I want to return r'$\pm$' using a list comprehension, but it returns \\ using["r'$\pm$'" for i in range(4)] returns ["r'$\\pm$'", "r'$\\pm$'", "r'$\\pm$'", "r'$\\pm$'"]Note that ["r'$\\pm$'" for i in...

View Article

Find leaf folders that aren't hidden folders

I have a folder structure with some epubs and json files in the down-most folders (not counting the .ts folders). I'm exporting tags from the json files to tagspaces, by creating a .ts folder with some...

View Article


AWS Lambda FastAPI background task problems

I have a simple FastAPI REST server running on AWS Lambda. It is writing logs to S3 using AWS Kinesis Firehose in batches of 20.I have 2 problems related to background tasks:The write background tasks...

View Article

How do I rewrite the function without lambda? [closed]

Essententially, I want a list of objects, with attributes of (self, sym:'str', x: int, y: int), to sort alphabetically by the sym attribute. I would include the code, but the above is an imported class...

View Article


Image may be NSFW.
Clik here to view.

image padding affects my image with grayscale background

I am working on a Python code to make a group of images (white background with black content) of equal size by adding white pixels (padding). But when running the code, a gray background appears as...

View Article

How do I calculate the date six months from the current date using the...

I am using the datetime Python module. I am looking to calculate the date 6 months from the current date. Could someone give me a little help doing this?The reason I want to generate a date 6 months...

View Article


Image may be NSFW.
Clik here to view.

How to add mean into boxplot visualization?

I was able to visualize my data in a boxplot using Seaborn.sns.boxplot( x=df['Score'].astype('float'), y=df['Group'] )The visualization shows me: all four quartiles, lower and upper whisker, and some...

View Article

VS Code ignores the installation of pandastable

I am trying to use pandastable, but although I already installed it with powershell it throws an error.I already installed it with pip install pandastable in the powershell as an admin without any...

View Article

Error: 'builtin_function_or_method' object has no attribute '__func__'

First time using LangChain, I'm following a guide and I'm getting this error, does anyone know what might be wrong? I'm using Pinecone along with this, I'm not sure if that makes a difference.For my...

View Article
Browsing all 23160 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>