Skip to main content

Question list filters

Filter by
Sorted by
Tagged with
Score of 1
2 answers
64 views

I have the following code: from dataclasses import dataclass @dataclass(frozen=True, slots=True) class Foo: attr1: int f = Foo(1) f.attr2 = 42 In Python 3.13+, I get a FrozenInstanceError, as ...
Score of -6
0 answers
48 views

I've been learning how to use pyglet, but I can't understand how the image function works: pyglet.image.load() What needs to go in the parentheses, and how do I specify what file this image is taken ...
Score of -5
1 answer
82 views

I'm attempting to connect a local Python application to a Google Workspace mailbox using an internal Web application OAuth client, authorization-code flow with PKCE, and a loopback callback. Consent ...
Score of -3
0 answers
44 views

I'm developing a handwriting-to-plotter application. I need to convert scanned handwritten text into one-pixel-wide centerlines and then trace those centerlines into coordinate polylines. My problem ...
Score of -6
0 answers
164 views

Is it possible to use ast to parse a single line? At the moment this falls over because of the white-space at the start of the line. Obviously I can strip this out but it will then be missing when I ...
Score of 1
0 answers
96 views

As noted in this answer and this docs, Python's builtin tuple supports Ellipsis (...) in generic annotations. For example, the following denotes a variable-length homogenous tuple of ints: tuple[int, ....
Score of 3
1 answer
101 views

I'm working on an asynchronous Python application where I use ContextVar to store request-specific information, such as a request ID. This allows me to access the current request ID from different ...
Score of 3
1 answer
90 views

I'm trying to compare words present within sentences in one column, to the first n words in a wordlist (in another column), and return the words in the sentences that don't exist in that subset of the ...
Score of -5
0 answers
93 views

I am trying to move from a prepackaged Flask/uWSGI to a custom Docker with Gunicorn. My Dockerfile is changed into: FROM python:3.13-slim ENV PYTHONDONTWRITEBYTECODE=1 \ PYTHONUNBUFFERED=1 \ ...
Score of 1
2 answers
151 views

According to this Q&A, Python constants are written in uppercase by convention and can be annotated with the Final qualifier. From the typing docs: typing.Final Special typing construct to ...
Score of 0
1 answer
142 views

I'm trying to make a bar chart showing pinned/unpinned vortices depending on tilt. Because of this, I want each bar to represent one vortex, and the y-axis to be the tilt. Currently I have this code, ...
Score of -5
0 answers
85 views

Years ago (2015-2020) I created a few hobby projects. The setup was extremely simple via: tiangolo/uwsgi-nginx-flask:latest docker image, a slim docker image with a production ready webserver simple ...
Score of 1
1 answer
212 views

I have this generic class: class Box[T]: def __init__(self, val: T): self.val = val In Python <3.12, that would be written: from typing import TypeVar, Generic T = TypeVar('T') class ...
Score of 0
2 answers
135 views

I query a DFS table from Python. select * gives me correct dates and tickers, but as soon as I list the columns, TIME turns into 8 and CODE turns into 22 — the numeric columns are fine. raw = session....
Score of 3
2 answers
147 views

I have this generic class in Python 3.12: class Box[T]: def __init__(self, val: T): self.val = val I can instantiate it in 3 ways: box: Box[int] = Box(42) box = Box[int](42) box = Box(...

15 30 50 per page
1
2 3 4 5
…
146952