2,204,224 questions
Score of 0
0 answers
3 views
Struggling to get initial traction for my open-source-based logging B2D startup. Any advice?
I recently launched a cloud logging platform for developers, powered by open-source client libraries in Python, Go, and TypeScript (TS is coming soon).
Being completely honest, traction is super low ...
Score of 1
0 answers
91 views
Three-body solver using RK45 produces incorrect "shifted" plot
I am trying to implement the RK45 (Runge-Kutta-Fehlberg) method (outlined here) from scratch for use in an N-body simulation. Testing my implementation against known periodic solutions, e.g. "...
Score of -6
1 answer
100 views
throwing exceptions to specific parts of the code in python [duplicate]
I'm attempting to create a variable type, and I want an error to occur if you make one of the values greater than 12 or less then 1 that points to where the value was changed.
class Date:
def ...
Score of 1
1 answer
70 views
Retrieve parameters of a redirected website on aiohttp
The code below contains a asynchronous def that sends a request to a OAuth2 server endpoint and when the server returns 200, the client is redirected to the given redirect point called redirect_uri ...
Score of -5
0 answers
68 views
Import hook at the AST level [closed]
Is there an Import Hook available for hooking into after the source code has been parsed into AST but before it is compiled?
I am looking for a way to keep using most of the existing Python import ...
Score of -6
0 answers
137 views
new to Python and i need help shipping app [closed]
i am learning python for fun, and i am making a simple app for my friend. however i am coding on a windows and he is on mac. what is the best way to make a app for mac from windows. Ive been trying to ...
Score of -3
3 answers
140 views
Python can't find function from imported module - first time creating an __init__.py file
I'm trying to better organize a long program I'm working on. In main.py I have this line: from core import *. There is a subfolder called core and in that folder I created a bunch of modules to ...
Score of -2
0 answers
78 views
Pydantic v2: default a generic Literal discriminator from its type parameter
I have a generic event base where the discriminator is a type parameter so subclasses don’t redeclare kind:
from typing import Annotated, Generic, Literal, TypeVar, Union
from pydantic import ...
Score of 2
1 answer
150 views
How to implement RK45 algorithm for N-body simulation
I am attempting to write a program that simulates the three-body problem using RK45 (or Runge-Kutta-Fehlberg) integration, following the outline given here PDF
I am ultimately trying to use RK45 to ...
Score of -4
1 answer
188 views
QGraphicsScene subclass will not add items which reimplement QGraphicsItem.itemChange, due to diamond-inherited QGraphicsScene subclass
QGraphicsScene subclass will not add items which reimplement QGraphicsItem.itemChange, due to QGraphicsScene subclass which inherits QGraphicsScene twice. This is not allowed in C++/Qt, its the ...
Score of -11
0 answers
160 views
Why cant the input() command let me output more commands? [closed]
Im trying to make a silly "terminal" simulator that has silly things like deleting all of your files if you try to access government secrets, but the var = input("string") command ...
Score of 2
1 answer
103 views
Nested asyncio.timeout(): both expired() return True, how to tell which one raised?
I have a retry loop with a per call timeout inside an overall budget:
import asyncio
async def fetch(budget, per_call):
try:
async with asyncio.timeout(budget) as outer:
for i ...
Score of -5
3 answers
167 views
Can I broadcast with numpy character find
I have an array of potential substrings and an array of full strings. I'd like to know which elements of the potential substrings are indeed found as substrings in the full array.
import numpy as np
...
Score of -3
0 answers
101 views
How Does AWS Lambda and Layers work with a Project that has Subdirectories? [closed]
I'm running into an issue with hosting some code on an AWS Lambda.
I'm trying to run a project on a Lambda with the following file structure:
my_layer.zip/
└── python/ # This folder ...
Score of 3
1 answer
140 views
How I can prevent flickering when I render graphics directly to Linux framebuffer using python?
I am experementing with linux framebuffers in order to display graphics on screen without using wayland or X11.
For that I made a simple script that renders a rectangle upon framebuffer:
import mmap
...