2,209,284 questions
0
votes
1
answer
19
views
Subclass of Generic fails with AttributeError: object has no attribute '__parameters__' - using Generic when superclass does forward __init_subclass__
I have a setup like the following
from typing import Generic, TypeVar
T = TypeVar("T")
class ThirdParty:
def __init_subclass__(cls):
... # does not call super()
class Mine(...
0
votes
0
answers
35
views
install error on Mac OS: 'ios' file not found ... failed building wheel for pandas
I am running into a consistent error with the PyPI install of apache superset 6.0.0. I am following the instructions from https://superset.apache.org/docs/6.0.0/installation/pypi/.
pip install apache-...
0
votes
1
answer
40
views
Pip wont let me install --user any more, shows externally managed env error
I have used --user in the past to not have to deal with virtualenvs in the past, but I cant seem to do it now, presumably on a different python version..
$ pip install --user esphome
error: externally-...
Best practices
0
votes
5
replies
49
views
Is there a better way to map a user input to a list of possible replies than this function I cobbled together?
I have this function I came up with as a python noob that takes an "inputMap", a 2-dimensonal array as follows:
exampleInputMap = [
['1', 'a', -1], # do the first action
['2', 'b'], ...
-1
votes
0
answers
22
views
Markdown notation stored in DuckDB, displayed in the "Shiny" WebApp as mathematical expression
Using DataGrid (Data Grid – Shiny for Python), how can LaTex/Markdown notation, which strings are stored in the cells of a DuckDB database file, be displayed in the Shiny webapp as human readible ...
0
votes
0
answers
23
views
Local unit testing apache airflow
Cannot Run Apache Airflow Unit Tests: sqlalchemy.exc.OperationalError: unable to open database file
I am attempting to run a single unit test within the Apache Airflow repository (airflow-core/tests/...
0
votes
1
answer
38
views
How to form a new socket connection with multithreading in Python
The project I'm working on is a simulation/ mock up of a VPN service. I've figured out how to connect multiple clients to a single server using loops and multi-threading, but now I'm struggling to ...
2
votes
1
answer
31
views
Matplotlib LaTeX text not respecting font family
I am trying to display a LaTeX-style equation in a Matplotlib plot using a custom font (Algerian). I want both the equation and the surrounding text to use the same upright (non-italic) font. Using ...
0
votes
0
answers
39
views
Bug when nesting "for" on iterators [duplicate]
Consider this Python snippet:
range1 = range(3)
range2 = range(2)
print([(e1, e2) for e1 in range1 for e2 in range2])
This displays 3x2 = 6 tuples, as expected:
[(0, 0), (0, 1), (1, 0), (1, 1), (2, 0)...
0
votes
0
answers
39
views
Finding Python installations besides Apple pre-installed (possibly from Anaconda) [closed]
How do I check how many Python installations I have on my Mac?
I am currently runing Tahoe 16.0.1 and Python is already present on my Mac from Apple but I also installed Anaconda which came with its ...
0
votes
1
answer
41
views
logging file is always empty
Here is a snippet of how logging is done in my test script:
logging.basicConfig(
level=logging.INFO,
format="%(asctime)s %(message)s",
datefmt="%Y%m%d %H:%M:%S",
...
-9
votes
1
answer
58
views
What are the different ways to reverse a string in Python? [duplicate]
I am learning Python and want to reverse a string.
Example:
Input: hello
Output: olleh
I know slicing works (s[::-1]) but I want to know if there are other Pythonic or recommended ways to do it. Is ...
-5
votes
0
answers
32
views
Kurose Ross - Video Streaming Project [closed]
I happen to have a project on the video streaming using RTSP and RTP from Kurose Ross and I'm stumping on how to implement HD video streaming for this. I have basically made everything work (fill in ...
-2
votes
0
answers
23
views
Azure Function App (Python 3.11 on Linux) stopped detecting all functions after Flex Consumption update – even Basic plan does not work [closed]
I’m running into a blocking issue with a Python 3.11 Azure Function App on Linux.
Until this week my Function App contained three HTTP-triggered Python functions and everything worked perfectly. After ...
-5
votes
4
answers
85
views
Python while loop not stopping when element is found in a tuple [closed]
I am trying to search for a number in a tuple using a while loop in Python. The program finds the element , but it does not stop and continues to run until the end of the tuple. Here is my code:
...