Category "python"

futures.wait() or futures.as_completed() blocked while all futures are Completed or Cancelled

I have a bug with futures.as_completed() or futures.wait() that will be blocked indefinitely when all Futures are completed or cancelled. Here the steps to repr

Python asyncio program does not exit waiting for stdin input

I have a complex Python 3.9 program that does not exit if interrupted with Ctrl-C (SIGINT). The following is a minimal repro of the problem. Run with python sam

FireBase Recaptcha verification failed - SITE_MISMATCH

I am using firebase identity toolkit from googleapi for phone verification on web. I have handled recaptcha for website too using site key and went to do post

Keras does not load because cannot find TensorFlow

Running Anaconda and installed: Keras = 2.4.3 TensorFlow = 2.4.0 However, when importing Keras - I get "Keras requires TensorFlow 2.2 or higher". Tried uninstal

How to create x264 RTSP server with OpenCV Python with GStreamer backend

My goal is to create a RTSP server using OpenCV Python using the GStreamer backend. I have RGB images stored as OpenCV Mat, and I would like to create a VideoWr

A way of selecting the next xpath element

How can i switch to the next element from a table using python and selenium. I have a website with a table that looks like this: https://i.stack.imgur.com/ZYwKU

Scraping users from Telegram failed

I trying to run below python program to scrape the member however i encounter error below.can anyone pls advise what wrong with code or due to bug? Traceback (

ValueError: could not convert string to float: '<kivy.uix.textinput.TextInput object at 0x0000011D49678430>'

I'm new at python and right now i try to make similar calculator with user input. I rewrote my code but its still dont work fine. Cant convert string property t

create dataframe as week and their weekly sum from dictionary of datetime and int

I have datetime and int values dictionary like below. details = { datetime.datetime.strptime("04-01-2021", "%d-%m-%Y") : 15, datetime.datetime.strptime(

How to send multiple files with Python requests to FastAPI server?

I have the following endpoint in my FastAPI server: @app.post("/submit") async def submit(file1: List[UploadFile] = File(...), file2: List[UploadFile] = File(..

Linking python and c++ on windows

I'm trying to create a python library, written in c++, using boost-python, and mingw to compile. c++ Code: char const* greet() { return "hello, world"; } #i

Looking to create a script to decrypt password protected PDF files

I have multiple directories of password protected PDF files and I'm looking to decrypt all of these files and save the resulting decrypted file as a new file in

Concatenate images from folders by their ORDER in python

I know how to concatenate two exact images, but I need to combine two images each from their own folder. I cannot do it by name of the image or don´t know

Matching vocabulary elements to indices from LDA Model using PySpark

I'd like to take a Spark LDA Model's term indices from the .describeTopics() output and match them to the appropriate term in the count vectorizer's vocabulary.

confusion with cppyy for overloaded methods and error handling

I have a c++ class with several constructors: MyClass(const std::string& configfilename); MyClass(const MyClass& other); I have python bindings for thi

Plotting border of masked array with plt.imshow

Actually plotting this image using plt.imshow and np.masked to plot the figure in blue. I would like to remove the inner part of the figure and just leaving the

tensorflow keras fit not showing any information

When using model.fit(), I only see the text "Epoch 1/10", and after a few seconds, it shows "Finished" with exit code: -1073740791 status: 1. My labels are a on

Reasonable neighbours for a bees algorithm on a not-complete digraph

I am trying to solve an optimization problem for a graph, where basically there is a cost for transporting "package" over a single edge, and I have multiple sou

Preparing data for Gephi with Python or R

I am currently trying to prepare my data for network analysis in Gephi. I have data in the following format: Raw Data SHIPMENTCOUNT US Port Foreign Initial Po

How do I import a full package but still call specific methods from a package directly?

I'm trying to both a module and an import from a module. I've been using from time import sleep for a few years now, but I'm wanting access to more of the featu