2,208,349 questions
0
votes
0
answers
4
views
Cannot resolve circular reference between two models
I have these two models (I've trimmed away extra fields to keep it readable):
class Forum(LegacyBase):
__tablename__ = "forums"
id: Mapped[int] = mapped_column("forumID", ...
0
votes
0
answers
15
views
Record Validation and Consistency Check on SCHOLAR.txt
A text file SCHOLAR.txt contains student academic records.
Each record is stored on one line in the following format:
RollNo@Name@Class@Section@SubjectCodes@Marks
Where:
RollNo → integer (no gaps ...
Best practices
0
votes
1
replies
13
views
How do I properly import a self-written module which depends on a third-party module within a program?
I am writing (in Python) a function for import and use in another program. This function takes standard Python data structures as input, e.g., list of strings, and outputs a numpy array based on the ...
-3
votes
0
answers
32
views
Dash design changed [closed]
My design in dash changed without me asking for it.
I'm using:
app = Dash(__name__, external_stylesheets=[dbc.themes.BOOTSTRAP])
And that gave me this design:
But for some reason it changed and now ...
0
votes
0
answers
23
views
Trying to write a Python plug-in for Gimp version 3.0.8 that selects a polygon
After a lot of digging and trying to sort out the older interface API from the gimp 3 version. I find I'm stuck. I'm using the code below to try to select a triangular area. The code runs in the ...
2
votes
1
answer
59
views
is_dir() False for relative path, but True for resolved path
I'm on Win11 and have a relative Path instance which for which is_dir() returns False:
>>> s = "../../../a/b/c"
>>> p = pathlib.Path(s)
>>> p.is_dir()
False
>&...
0
votes
0
answers
28
views
Why does .view() fail after permuting dimensions for a GRU?
I'm trying to train a character-level GRU on Linux kernel source but the training loop keeps crashing with this error:
RuntimeError: view size is not compatible with input tensor's size and stride (...
Advice
0
votes
1
replies
22
views
How do I extend my Python cash machine program to handle multiple accounts?
I have made a Python function that simulates a cash withdrawal from an ATM, checking for the correct PIN and sufficient balance before processing.
I have defined a function called cash_machine with ...
0
votes
0
answers
28
views
Is there a way to use sc.exe create instead of NSSM for a Uvicorn/FastAPI application?
It's not recommended in the current scope to download NSSM, and we have used sc create for other services before. However, it seems that sc create is having trouble actually accessing the API. I've ...
0
votes
1
answer
49
views
I'm tying to combine Excel files from two different years of labor costs. One of the files numerical data is doubling and I can't find the reason
I'm using two excel files (each file for the years 2024 and 2025) and combining the files through Pandas. I discovered this issue when checking the sums that my program outputs and comparing them to ...
0
votes
0
answers
33
views
cupy kernel template for elementwise reductions
I want to get the kernel template that cupy uses for its subtract function to compare with my (really simple) kernel:
subtract_kernel = cp.RawKernel(
"""
extern "C" __global__
...
-1
votes
1
answer
25
views
Selenium nested for loop iteration in iteration over urls
I am trying to iterate through a list of Urls find some elements, one of which is a list of other Urls.
I then want to, in the same overarching loop iterate through the second list of Urls and find a ...
0
votes
0
answers
13
views
OTEL Auto Instrumentation for Python Logging
I have been trying to test OTEL auto instrumentation for Python and been having trouble getting metrics, traces, and logs to all be properly exporting consistently. I have been attempting this will ...
-1
votes
0
answers
24
views
How to paginate output [closed]
I want to paginate over potentially thousands of objects.
I want to offer users a list of buttons they can pick. The list depends on a search of a database and the number of buttons could be between 0 ...
Best practices
0
votes
2
replies
16
views
How to build crash-resumable, deterministic workflows in Python without a full workflow engine
I’m building a backend workflow runner where each job is a sequence of steps (mix of pure compute and side-effects like HTTP calls, DB writes, file uploads). If the process crashes mid-step, the job ...