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

How to synchronize a python dictionary across a flask app and a background...

Here is my problem. I have a Flask application which does some predictions on some datasets. The users can upload multiple datasets to the server and operate on any of the dataset.Here, I need to clean...

View Article


Bad: so many ifs

In my code with tg bot and database there was a problem with the exchange function. The bot was exchanging some user coins for others. Here is the user model:class User: lucky: Mapped[int] =...

View Article


Cython: How can I import multiple class object from a single file?

So this is how I currently structure my files.CPP FolderCython Folder├── setup.py└── Geometry├── Circle│├── __init__.py│├── Circle.pyx│├── Circle.pyi│└── Circle.pxd└── Point├── __init__.py├──...

View Article

Efficient algorithm for comparing lists [closed]

Input - list of 24 integers from -15 to 15; let's call it Sequence. Another input - list of 7000+ lists of four integers from 0 to 23 representing offsets of Sequence. For example [0, 3 , 5,8] or...

View Article

Why my sliding-tile python code is not working

I am trying to solve sliding-tile problem using Hill climbing algorithm in python where in I want to print the each intermediate step but my code isn't showing any output. I don't think so that any...

View Article


How to fix this issue "ERROR: Failed building wheel for insightface"

note: This error originates from a subprocess, and is likely not a problem with pip.ERROR: Failed building wheel for insightfaceFailed to build insightfaceERROR: Could not build wheels for insightface,...

View Article

How to create a timeseries from a dataframe of event durations?

I have a dataframe full of bookings for one room (rows: booking_id, check-in date and check-out date that I want to transform into a timeseries indexed by all year days (index: days of year, feature:...

View Article

Image may be NSFW.
Clik here to view.

Combine two lists without duplicate values

list1 = ["palani", "samy","be"]list2 = ["palani", "samys","be"]def find_common(list1,list2): for x in list1: for y in list2: if x == y : list2.remove(x) print" unique string 1:",list1 print" unique...

View Article


pymysql cannot connect to mysql

I am trying to use pymsql to connect to MySQL db, the host is '115.28.236.225', and using the default port: 3306. The code is as bellow (db_connect.py):import pymysqldef connDB():...

View Article


Can not create shortcut of file using google drive api

Here is sample code that i am trying to run.import requestsapi_endpoint = 'https://www.googleapis.com/upload/drive/v3/files?supportsAllDrives=true'headers = {'Authorization': f'Bearer...

View Article

Selenium python webdriver intermittently thowing error

we seeing below error intermittently when we run python test cases on seleniumself = <selenium.webdriver.remote.errorhandler.ErrorHandler object at 0x7fb8457b1b70>[2024-04-25T07:02:26.028Z]...

View Article

Add a dropdown menu in a table with Reflex Python

I'm trying to add a dropdown menu to each row in a table with the use of reflex https://reflex.dev/. The table is build in a state and buttons generally in definitions. This is an example that can be...

View Article

Radio button to control display to the right in Reflex - display not updating

Recently, I am looking into Python framework call Reflex for building web apps.What I want to achieve:When I select different code names in radio box, the code block to the right display corresponding...

View Article


UnicodeDecodeError when using the Python "reflex init" command

I am trying to run the Python Reflex Framework on Windows 10, with a python version 3.10.5; I get an error when using the command "reflex init" (it should be mentioned that I use a virtual...

View Article

Image may be NSFW.
Clik here to view.

Python Reflex (Pynecone) - data_table with checkbox in one column

I am trying to build a data table that includes a checkbox in the first column using python reflex to build web app front end interface.This is an example table obtained with:import reflex as rxdef...

View Article


Index error with moviepy when running on aws

I am getting this error:"MoviePy error: failed to read the duration of file %s.\n"OSError: MoviePy error: failed to read the duration of file...

View Article

Image may be NSFW.
Clik here to view.

Hierarchical classification approach to a multiclass problem

Having a multiclass classification task. My goal is to solve this using the Local Classifier per Parent Node (LCPN) approach.Let me explain using a MWE.Say I have this dummy dataset:import numpy as...

View Article


Qcompleter for QAbstractTableModel's All Columns in Qcombobox

I have a large dataset with 3 million rows and more than 5 columns, (increasing data day by day)I want to get the row data by typing the text in Qcombobox(editable) with matching records highlitedWhat...

View Article

parse the URL from content : Python [duplicate]

I want to parse the URL from some small content using python code ,for example"@you some text https://url.com"I'd like to take this URL alone.if there any library can use it for that ?anyone can help...

View Article

Image may be NSFW.
Clik here to view.

Issues with FastAPI Uvicorn workers | Only one worker is handling the request

I have a sample FastAPI application, with a single endpoint which returns the result a after a delay of 5 seconds.Please find the code below.from fastapi import FastAPIimport uvicorn, os, timeapp =...

View Article
Browsing all 23101 articles
Browse latest View live