2,205,193 questions
Score of 2
1 answer
107 views
Trying to Change A Pixel in Python [closed]
I'm trying to change a pixel to red. However, when I run the code, the pixel remains unedited. Can you help?
import cv2 as cv
import os
import matplotlib.pyplot as plt
def readAndWriteImage():
...
Score of 1
0 answers
50 views
ConnectionResetError: [WinError 10054] in asyncio Proactor event loop on Windows (Python 3.13) without explicit socket handling
I am attempting to run an asyncio-based web application (Zedstron/babymonitor) on Windows using Python 3.13, but I am consistently encountering standard library logging errors related to ...
Score of -3
0 answers
64 views
VS Code Python Extension fails to set Anaconda base interpreter ("Invalid Python interpreter selected" / clicking interpreter does nothing)
I am using VS Code on Windows 11 with Anaconda installed at C:\Users\username\anaconda3. Running Python scripts directly from the Anaconda Prompt works completely fine, but VS Code fails to recognize ...
Score of -11
0 answers
127 views
Reddit Bot request got rejected by reddit and show me "Something went wrong logging in" [closed]
My bot loads the Reddit login page then finds the form field then types in the username and password and then clicks the login button. But every time I get
<faceplate-alert level="3" ...
Score of -1
0 answers
50 views
yaml.scanner.ScannerError: mapping values are not allowed here - error when trying to use Detectron2 for layout mapping in WSL2 in Windows 11
I am trying to extract text from a PDF file and for this detecting layout before extracting texts. I am using Detectron2 inside WSL2. My code snippet is
MODEL = lp.models.Detectron2LayoutModel(
# ...
Score of -4
0 answers
101 views
Constraint Programming beginner -- why aren't my constraints showing up? [closed]
I'm trying to create a simple constraint problem: We have clinicians with a schedule. We have patients with a schedule. Is it possible for clinicians and patients to meet?
I wrote code based off of ...
Score of -1
0 answers
43 views
PPO Agent refuses to place orders in custom Gymnasium Inventory Environment (stuck in local minimum)
I am building an RL-based Inventory Management System using Python, Gymnasium, and Stable-Baselines3 (PPO). The environment simulates a single SKU (Item-Centric approach).
The agent's goal is to ...
Score of 1
2 answers
121 views
Copy to stdout with CSV header always hangs
Using the pattern provided in the documentation.
SQLAlchemy version is 2.0.51
psycopg version is 3.3.4
from sqlalchemy import create_engine
dbURL = "postgresql+psycopg://sud:[email protected]/...
Score of 1
1 answer
97 views
How do I get correct type hints in subclass?
In my program (full source shown below), I have defined the following classes:
NodePath - represents a string path (ie. .some.path.to.something)
Node - populates an instance of NodePath
NodeTree - ...
Score of 0
3 answers
114 views
b64encode() / b64decode - unbalanced encoding
Why does the output from b64encode() need to be decoded with utf-8 to convert it to a string while the output from b64decode needs to be decoded with utf-32 to do the same?
import base64
in_str = r&...
Score of 3
0 answers
82 views
How do you stitch together 3 meshes in Python?
I tried using PyMeshLab, Trimesh, Pyvista, but the results weren't satisfactory because the cylinder itself was deformed (waves appeared, as shown in the image in the output of code version #1). I ...
Score of -1
1 answer
92 views
Using Python PIL.Image module, <image>.paste() returns None
I was trying to overlay an image of a shirt over an image of a person, by using im.paste() from the PIL.Image module, but it somehow returns None, which I don't understand. I think according to the ...
Score of -1
1 answer
97 views
How do I pass class variables to functions imported from another module?
I have a tkinter main application with a lot methods. Many of these methods are bound to widgets in my application. Some take "event" as input, some do not. Many of them use class variables ...
Score of 0
2 answers
137 views
How to retrieve a variable from another threading.Thread?
I wrote an initial Python script that retrieves a piece of information and writes it to the first line of a text file (data.txt). Now I want to create a GUI using Tkinter to display this information. ...
Score of -1
0 answers
75 views
Controller hotplugging issue
I am trying implement controller hotplug support with pygame 2.6.1. According to the docs, this can be achieved with JOYDEVICEADDED, JOYDEVICEREMOVED events.
Example:
import sys
import pygame
pygame....