Category "python"

What's the best practice for Python multiprocessing to write to a shared dictionary?

I have millions of NumPy arrays that I wish to process, ultimately generating a collective histogram plotting the frequencies of seen integers. I wish to utiliz

Bad Request | CSRF Token Not Found | CSRF Handling for Flask WTF

The Issue I work for a couple of simple volunteering organizations helping with management and running campaigns, but we needed a system to track peoples hours

What is the right way to measure server/client latency (TCP & UDP)

I am sending and recieving packets between two boards (a Jeston and a Pi). I tried using TCP then UDP, theoritically UDP is faster but I want to verify this wit

How can I detect image artifacts?

I need to make the script that will return True if image contains visual artifacts that look like gray clusters of pixels Kind of artifact that I want to catch

pandas - how to access the value of next 16 rows as a list of 16 numbers

Say I have just 2 columns in pandas. Column 1 has all numerical values and column 2 has values only at the every 16th position (so column 2 has value at index 0

How to search by dict keys in ElasticSearch

I am new in elasticsearch and I need to write query described below I have an elasticsearch index with documents like this one Numbers mean entries of words in

Quart error: ImportError: cannot import name 'Headers' from 'h11._headers'

i want to start a dashboard for my nextcord bot But when i import dashboard to run,it’s raise an error I tried search on internet for this but look like i

Python replace random specific element in list

I have a list containing many alphabets, and I want to replace a random "a" with "b", how can I do it? alphabets = ["a", "c", "a", "a", "b", "c"] Examples of w

How to map 5 numbers to 5 different colors

I have a problem concerning the management of a colormap. In the figure below, each point displayed is associated with a value : 2, 3, 4, 5 or 13. So, to know t

How to extract specified text from columns in Excel

I have tried numerous ways but have failed to get the right data to the new columns. The column description contains a lot of information in which I want to ext

Why does Tkinter image not show up if created in a function?

This code works: import tkinter root = tkinter.Tk() canvas = tkinter.Canvas(root) canvas.grid(row = 0, column = 0) photo = tkinter.PhotoImage(file = './test.g

How i can find a specific row and look for the minimum element index in a numpy array

I got a numpy array from a csv file. It is 6 X 6. I want to find a specific row and then find the lower element index.

How i can find a specific row and look for the minimum element index in a numpy array

I got a numpy array from a csv file. It is 6 X 6. I want to find a specific row and then find the lower element index.

Pymeshfix Error while trying to repair a stl file

If i try to repair an input stl file (https://www.file-upload.net/download-14916065/waxup_slm_cad.stl.html) with the library pymeshfix (https://github.com/pyvis

Client seems to hang after a specific reply from server

I am implementing an authentication process between a server and a client in order to exchange some information. I have created a function called serverToClient

How to define the pen width in the menu bar

I am trying to write the code for my own paint program. I have added the menu for few basic color options. Now I would like to add the same menu style pen width

How to rotate a rectangle/bounding box together with an image

I'm working on a data augmentation and im trying to generate synthetic version of every image in my dataset. So i need to rotate images and together with boundi

Python Image Library and Tkinter Clashing

I have an issue where PIL and Tkinter are not working together in the same program. Basically, I tried to run my program and when it was on the line 'image.open

Fastest way to remove white background from image/video

I need to make the below faster as I need it to run on a video. Basically I am trying to remove a white background on a video and then overlay that onto another

Updating database after reordering Datatable

I'm struggling with the datatables reordering. I want when user reorder to update table in the database. For this to happen i need: to configure the datatable t