QuestionId
int64
74.8M
79.8M
UserId
int64
56
29.4M
QuestionTitle
stringlengths
15
150
QuestionBody
stringlengths
40
40.3k
Tags
stringlengths
8
101
CreationDate
stringdate
2022-12-10 09:42:47
2025-11-01 19:08:18
AnswerCount
int64
0
44
UserExpertiseLevel
int64
301
888k
UserDisplayName
stringlengths
3
30
79,574,302
13,946,204
How to make dynamic path that will be represented as list in aiohttp server?
<p>Let's say that I have an example code:</p> <pre class="lang-py prettyprint-override"><code>from aiohttp import web async def example(r): a = r.match_info.get('a') b = r.match_info.get('b') c = r.match_info.get('c') return web.Response(text=f'[{a}, {b}, {c}]') app = web.Application() app.add_routes(...
<python><query-string><aiohttp>
2025-04-15 02:49:18
2
9,834
rzlvmp
79,574,248
28,063,240
Python csv DictReader with optional header
<pre class="lang-py prettyprint-override"><code>import csv import io FIELDNAMES = ['one', 'two', 'three'] def print_data_rows(csvfile): reader = csv.DictReader(csvfile, fieldnames=FIELDNAMES) for row in reader: print(row) headerless = r''' 1,2,3 ''' print_data_rows(io.StringIO(headerless.strip()))...
<python><python-3.x>
2025-04-15 01:29:55
4
404
Nils
79,574,127
12,158,757
Cannot see all `Dense` layer info from `search_space_summary()` when using `RandomSearch Tuner` in Keras-Tuner?
<p>I am trying to use <code>keras-tuner</code> to tune hyperparameters, like</p> <pre><code>!pip install keras-tuner --upgrade import keras_tuner as kt from tensorflow.keras.models import Sequential from tensorflow.keras.layers import Dense, Flatten from tensorflow.keras.optimizers import Adam def build_model(hp): ...
<python><tensorflow><keras><hyperparameters><keras-tuner>
2025-04-14 22:45:31
1
105,741
ThomasIsCoding
79,574,073
2,133,121
how to find full delta using python deepdiff?
<p>I wrote the following simple test:</p> <p><strong>deeptest.py</strong></p> <pre><code>from deepdiff import DeepDiff, Delta dict1 = {'catalog': {'uuid': 'e95fb23c-57d2-495f-8ab5-2c6b3152bcee', 'metadata': {'title': 'Catalog', 'last-modified': '2025-04-10T16:00:34.033789-05:00', 'version': '1.0', 'oscal-version': '1....
<python><python-deepdiff>
2025-04-14 22:04:19
1
413
user2133121
79,574,036
873,107
Using Sympy with an External Function with CTypes
<p>I am attempting to leverage sympy to solve a set of equations. However, some of the equations are dependent upon functions that I can only interface via a ctypes interface. The end goal is to use fluid property calculations that are defined in the NIST Refprop python interface called ctRefprop.</p> <p>I have been un...
<python><sympy><ctypes>
2025-04-14 21:32:20
2
453
Justin Kauffman
79,573,914
1,420,489
Can you include a standalone executable in a Python package with pyproject.toml?
<p>Looking at Python packaging with <code>pyproject.toml</code>, I wonder whether it is possible to add a standalone executable (with <code>#!/usr/bin/env python</code> in the first line) to <code>pyproject.toml</code>, without going for a <code>[project.scripts]</code> entrypoint definition and the corresponding auto-...
<python><python-packaging>
2025-04-14 19:48:11
0
4,808
xealits
79,573,908
5,675,325
OpenAI Assistants with citations like【4:2†source】and citeturnXfileY
<p>When streaming with OpenAI Assistants</p> <pre><code>openai.beta.threads.messages.create( thread_id=thread_id, role=&quot;user&quot;, content=payload.question ) run = openai.beta.threads.runs.create( thread_id=thread_id, assistant_id=assistant_id, stream=True, tool_choice={&quot;type&quo...
<python><fastapi><openai-api><openai-assistants-api>
2025-04-14 19:42:52
1
15,859
Tiago Peres
79,573,889
10,917,549
Running DeepSeek-V3 inference without GPU (on CPU only)
<p>I am trying to run the DeepSeek-V3 model inference on a remote machine (SSH). This machine does not have any GPU, but has many CPU cores.</p> <p><strong>1rst method/</strong></p> <p>I try to run the model inference using the <a href="https://github.com/deepseek-ai/DeepSeek-V3?tab=readme-ov-file#61-inference-with-dee...
<python><pytorch><huggingface-transformers><huggingface><deepseek>
2025-04-14 19:35:59
0
409
The_Average_Engineer
79,573,882
395,857
How can I deploy a fine-tuned GPT model in Azure via Python without using a token (e.g., using an endpoint key instead)?
<p>I follow Azure's <a href="https://learn.microsoft.com/en-us/azure/ai-services/openai/tutorials/fine-tune?tabs=python-new%2Ccommand-line" rel="nofollow noreferrer">tutorial</a> on fine-tuning GPT. Here is the code for the deployment phase:</p> <pre><code># Deploy fine-tuned model import json import requests token =...
<python><azure><azure-openai><fine-tuning><gpt-4>
2025-04-14 19:27:27
1
84,585
Franck Dernoncourt
79,573,819
2,009,612
PyMySQL mogrify not taking list of dicts as argument
<p>I'm trying to simply log my queries and their parameters using the <code>pymysql.cursor.mogrify()</code> function as detailed in the documentation.</p> <pre class="lang-py prettyprint-override"><code>python-1 | INFO:__main__:Creating records. python-1 | INFO:trex.confluence.main:Creating templates with [{'template...
<python><flask><pymysql>
2025-04-14 18:41:12
1
3,766
FilBot3
79,573,796
1,406,168
Having secrets locally when pip installing a private github repo
<p>I have this pipeline:</p> <pre class="lang-yaml prettyprint-override"><code>name: Build and deploy Python app to Azure Web App - app-xx-xx-api-dev on: push: branches: - dev workflow_dispatch: jobs: build: runs-on: ubuntu-latest permissions: contents: read steps: - uses: act...
<python><pip><github-actions><python-packaging>
2025-04-14 18:30:39
1
5,363
Thomas Segato
79,573,744
15,528,750
Django Advanced Tutorial: Executing a Command in Dockerfile Leads to Error
<p>I followed the <a href="https://docs.djangoproject.com/en/5.2/intro/reusable-apps/" rel="nofollow noreferrer">advanced django tutorial</a> on reusable apps, for which I created a Dockerfile:</p> <pre class="lang-none prettyprint-override"><code>FROM python:3.11.11-alpine3.21 # Install packages (acc. to instructions...
<python><django><docker>
2025-04-14 17:44:32
1
566
Imahn
79,573,720
242,042
Is there a way to automate activating the virtualenv in Powershell (in Windows)?
<p>I know that to activate virtualenv it's just <code>.venv/Scripts/activate.ps1</code> but I was wondering if there's a way of having powershell do it automatically?</p> <p>Existing ones just talk about activating it, but not how to have Powershell do it automatically</p> <ul> <li><a href="https://stackoverflow.com/qu...
<python><windows><powershell><virtualenv>
2025-04-14 17:30:36
2
43,097
Archimedes Trajano
79,573,717
774,575
Signal declaration in a separate class for use with QRunnable worker
<p>I'm defining a Qt signal in a separate class derived from <code>QObject</code> for use in a <code>QRunnable</code> worker. The signal is emitted once by the worker as it completes. When creating two workers, the signal is received twice for each workers (hence received 4 times, if there were 3 workers, the signal wo...
<python><qt5><signals><qtpy>
2025-04-14 17:28:18
1
7,768
mins
79,573,704
8,387,076
How to fix `InvalidRequestError: Can't attach instance <ClassName at 0x7baada2f3cb0>` in SQLAlchemy relationships?
<p>I have already gone through quite a few answers on SO (eg. <a href="https://stackoverflow.com/a/61421908/8387076">this one</a> and <a href="https://stackoverflow.com/q/47912520/8387076">this one</a>, but none of them seem to work for me.</p> <p>I am using SQLAlchemy with sqlite, python 3.13.3. In case it matters, th...
<python><sqlite><sqlalchemy><orm><relationship>
2025-04-14 17:19:34
0
1,403
Wrichik Basu
79,573,564
2,287,458
Group-By column in polars DataFrame inside with_columns
<p>I have the following dataframe:</p> <pre><code>import polars as pl df = pl.DataFrame({ 'ID': [1, 1, 5, 5, 7, 7, 7], 'YEAR': [2025, 2025, 2023, 2024, 2020, 2021, 2021] }) shape: (7, 2) ┌─────┬──────┐ │ ID ┆ YEAR │ │ --- ┆ --- │ │ i64 ┆ i64 │ ╞═════╪══════╡ │ 1 ┆ 2025 │ │ 1 ┆ 2025 │ │ 5 ┆ 2023 │ │ 5 ...
<python><dataframe><group-by><window-functions><python-polars>
2025-04-14 15:57:58
1
3,591
Phil-ZXX
79,573,543
2,021,948
I don't find pip.conf file in my file system
<p>I work with Linux Ubuntu 22.04 LTS, Python 3.10.12, Pip 22.0.2 and rasa version 3.12.2. And I've also studied the answers of <a href="https://stackoverflow.com/questions/38869231/python-cant-find-the-file-pip-conf/79475811?noredirect=1#comment140336865_79475811">this question</a>, but they didn't resolve my problem<...
<python><linux><pip><rasa>
2025-04-14 15:49:50
3
985
Uwe_98
79,573,496
14,463,396
Folium heatmap with tooltips
<p>I'm trying to create a heatmap with tool tips displaying additional information when the user rolls their mouse over that area. Example of the data I have is:</p> <pre><code>heat_df = pd.DataFrame({'Latitude':[45.3288, 45.3311], 'Longitude':[-121.6625, -121.6625,], 'C...
<python><dictionary><folium>
2025-04-14 15:24:12
1
3,395
Emi OB
79,573,420
3,322,273
Should I always use asyncio.Lock for fairness
<p>I have a Python service that uses Python's virtual threads (<code>threading.Thread</code>) to handle requests. There is a shared singleton functionality that all threads are trying to access, which is protected using <code>threading.Lock</code>.</p> <pre><code>g_lock = threading.Lock() def my_threaded_functionality(...
<python><multithreading>
2025-04-14 14:48:33
2
12,360
SomethingSomething
79,573,391
12,187,881
How to use peewee for `COPY FROM` with `FORMAT BINARY`?
<p>I'm trying to load sparse vectors into a table managed by PostgreSQL. For simplicity, let's suppose that the table has only two fields: a vector ID and the vector itself (which is the result of applying <a href="https://scikit-learn.org/stable/modules/generated/sklearn.feature_extraction.text.TfidfVectorizer.html#sk...
<python><postgresql><peewee>
2025-04-14 14:39:43
0
381
TopCoder2000
79,573,374
5,037,202
How to process large files efficiently with generators in Python without memory issues?
<p>I’m working on a data processing pipeline in Python that needs to handle very large log files (several GBs). I want to avoid loading the entire file into memory, so I’m trying to use generators to process the file line-by-line.</p> <p>Here’s a simplified version of what I’m doing:</p> <pre><code> def read_large_file...
<python><performance><memory-management><file-io><generator>
2025-04-14 14:30:00
0
477
Waqas Gondal
79,573,370
2,233,500
CairoSVG: The SVG size is undefined
<p>I need to convert a SVG file into a PNG. To do so, I'm using CairoSVG, which works fine. I have however an image causing the CairoSVG package to raise an Exception, and I don't understand why. Note that the problematic image is public (Wikipedia), which is a good thing for sharing the code bellow:</p> <pre class="la...
<python><cairo>
2025-04-14 14:25:31
1
867
Vincent Garcia
79,573,357
16,383,578
What is a faster way to find all unique partitions of an integer and their weights?
<p>I have seen loads of posts on this topic, but none are exactly what I am looking for.</p> <p>I want to find all ways a positive integer N that is greater than 1 can be expressed as the sum of at most N integers from 1 up to N, just like the usual.</p> <p>For example, in the standard notation, these are all the parti...
<python><algorithm><number-theory><integer-partition>
2025-04-14 14:18:46
2
3,930
Ξένη Γήινος
79,573,330
1,866,177
Pandas Dataframe unique values per group based on label
<p>I have a dataframe with two labels e.g.:</p> <pre><code>df = pd.DataFrame({'Brand': ['VW', 'VW', 'BMW', 'BMW', 'Mercedes'], 'color': ['red', 'red', 'red', 'blue', 'black']}) &gt;&gt;df Brand color 0 VW red 1 VW red 2 BMW red 3 BMW blue 4 Mercedes black <...
<python><pandas><unique>
2025-04-14 14:05:30
0
3,930
Dschoni
79,573,221
7,112,039
Keep context vars values between FastAPI/starlette middlewares depending on the middleware order
<p>I am developing a FastAPI app, and my goal is to record some information in a Request scope and then reuse this information later in log records.</p> <p>My idea was to use context vars to store the &quot;request context&quot;, use a middleware to manipulate the request and set the context var, and finally use a LogF...
<python><fastapi><starlette><python-contextvars><fastapi-middleware>
2025-04-14 13:07:09
2
303
ow-me
79,573,192
9,973,879
What's wrong with numpy_nullable and NaNs?
<p>Doing the same operation using plain <code>numpy</code>, the <code>numpy_nullable</code> backend and the <code>pyarrow</code> backend shows that <code>numpy_nullable</code> behaves differently than the other two and in a rather counter-intuitive way.</p> <pre class="lang-py prettyprint-override"><code>&gt;&gt;&gt; i...
<python><pandas>
2025-04-14 12:49:45
1
1,967
user209974
79,572,852
10,755,782
How can I access the original xlo/xhi box bounds from a LAMMPS dump file using MDAnalysis in Python?
<p>I'm working with a LAMMPS trajectory in MDAnalysis using the default LAMMPSDUMP format, like this:</p> <pre><code>import MDAnalysis as mda u = mda.Universe(&quot;datfile.data&quot;, &quot;dump.LAMMPSDUMP&quot;) </code></pre> <p>In my LAMMPS dump file, the box bounds are written explicitly and do not start at '0', fo...
<python><lammps><mdanalysis>
2025-04-14 09:54:33
0
660
brownser
79,572,849
2,239,318
python-docx header set anchor "to page"
<p>Problem: put a logo image at top left position of the page.</p> <p>I've tried the following to accomplish the same but it doesn't work as expected:</p> <pre><code>from docx import Document from docx.shared import Mm, Pt from docx.enum.text import WD_PARAGRAPH_ALIGNMENT doc = Document() # A4 vertical section = doc.s...
<python><python-docx>
2025-04-14 09:53:06
2
2,826
user2239318
79,572,697
17,040,989
produce nice barplots with python in PyCharm
<p>I'm working on a very basic barplot in <code>Python</code> where I need to plot a series of length occurrences showcasing how many times a specific one appears.</p> <p>I'm storing everything in an array, but when I attempt to plot I either get the <em>y</em>-scale wrong, or on the <em>x</em>-axis all the instances w...
<python><matplotlib><pycharm><seaborn><bar-chart>
2025-04-14 08:30:41
1
403
Matteo
79,572,640
1,145,666
suds is not using HTTPS, even though the URL is set correctly
<p>Consider this code:</p> <pre><code>from suds.client import Client wsdl = &quot;https://path/to/scv?wsdl&quot; client = Client(wsdl) token = client.factory.create(&quot;ns1:AuthenticationToken&quot;) token.LoginName = &quot;login&quot; token.UserId = &quot;userid&quot; token.Password = &quot;password&quot; client....
<python><https><suds>
2025-04-14 08:02:29
1
33,757
Bart Friederichs
79,572,562
16,383,578
PyPy3 on Windows 11 doesn't display non-ASCII characters correctly
<p>PyPy3 doesn't display non-ASCII UNICODE characters correctly.</p> <p>A simple example, the following:</p> <pre><code>b'\xce\x9e\xce\xad\xce\xbd\xce\xb7 \xce\x93\xce\xae\xce\xb9\xce\xbd\xce\xbf\xcf\x82'.decode('utf8') </code></pre> <p>Should evaluate to my user name: <code>'Ξένη Γήινος'</code>.</p> <p>But the output ...
<python><utf-8><pypy>
2025-04-14 07:24:18
1
3,930
Ξένη Γήινος
79,572,368
9,951,273
Parsing Pydantic dict params
<p>I have an endpoint that takes a Pydantic model, <code>Foo</code>, as a query parameter.</p> <pre class="lang-py prettyprint-override"><code>from typing import Annotated import uvicorn from fastapi import FastAPI, Query from pydantic import BaseModel app = FastAPI() class Foo(BaseModel): bar: str baz: dic...
<python><request><fastapi><pydantic>
2025-04-14 04:54:41
1
1,777
Matt
79,572,227
12,603,110
How to annotate a Pandas index of datetime.date values using Pandera and mypy?
<p>I'm using Pandera to define a schema for a pandas DataFrame where the index represents calendar dates (without time). I want to type-annotate the index as holding datetime.date values. Here's what I tried:</p> <pre><code># mypy.ini [mypy] plugins = pandera.mypy </code></pre> <pre class="lang-py prettyprint-override"...
<python><pandas><python-typing><mypy><pandera>
2025-04-14 01:08:05
1
812
Yorai Levi
79,572,177
4,398,952
Subclass of tkinter's Toplevel class doesn't seem to inherit "tk" attribute
<p>I'm writing a Python application using tkinter GUI. I created the <em>TimestampWindow</em> class which should be one of my Windows and made it extend the <em>Toplevel</em> class of tkinter's library and <em>Window,</em> a custom class where I put common attributes/methods for all my Windows. Unfortunately when I tr...
<python><tkinter><multiple-inheritance><toplevel>
2025-04-13 23:50:49
1
401
ela
79,572,155
389,119
How to automatically start the debugging session in Playwright?
<p>I want to automatically start the debugging session instead of having it starting as paused. I found out that adding this code makes it work but it feels hackish to me:</p> <pre><code>context.add_init_script(&quot;setTimeout(window.__pw_resume, 500)&quot;) </code></pre> <p>Without the <code>setTimeout</code>, it won...
<python><playwright><playwright-python>
2025-04-13 23:10:56
1
12,025
antoyo
79,571,959
5,224,236
Efficient rolling, non-equi joins
<p>Looking for the current most efficient approach in either R, python or c++ (with Rcpp).</p> <p>Taking an example with financial data,</p> <pre><code>df time bid ask time_msc flags wdayLab wday rowid &lt;POSc&gt; &lt;num&gt; &lt;num&gt; ...
<python><c++><r><data.table><python-polars>
2025-04-13 19:30:25
2
6,028
gaut
79,571,953
508,402
re.search() raises recursion depth error when in thread
<p>In MicroPython, <code>re.findall()</code> does not exist. Therefore, I made one myself:</p> <pre><code>def findAll(pattern, s, flags = 0): found = [] while True: m = re.search(pattern, s, flags) if m: g = m.groups() s = s[m.span()[1]:] found.append(g[0] if ...
<python><multithreading><micropython><raspberry-pi-pico>
2025-04-13 19:23:20
0
494
resurrected user
79,571,947
1,747,834
How to run a command over an ssh tunnel?
<p>I'm trying to automate launches of VNC-clients for multiple remote systems. Currently I achieve that with a <code>LocalForward 15900 127.0.0.1:5900</code>. VNC uses port 5900 by default, which is fine -- there should only be one VNC-server at a time on any machine. But I may some times have multiple VNC-viewers ru...
<python><paramiko><ssh-tunnel>
2025-04-13 19:18:50
1
4,246
Mikhail T.
79,571,814
5,118,421
SQLAlchemy session.query(object) returns automap object without __dict__
<p>I follow up this <a href="https://django.fun/docs/sqlalchemy/2.0/orm/extensions/automap/" rel="nofollow noreferrer">tutorial</a> and got an error.</p> <p>Code:</p> <pre><code>engine = create_engine(&quot;sqlite:///mydatabase.db&quot;) # reflect the tables Base.prepare(autoload_with=engine) # mapped classes are now...
<python><sqlalchemy>
2025-04-13 17:06:12
0
1,407
Irina
79,571,751
9,506,773
How to catch findTransformECC error (-7:Iterations do not converge)
<p>I am using ECC for camera motion compensation but it fails with the following error:</p> <p><code>OpenCV(4.11.0) /Users/xperience/GHA-Actions-OpenCV/_work/opencv-python/opencv-python/opencv/modules/video/src/ecc.cpp:589: error: (-7:Iterations do not converge) The algorithm stopped before its convergence. The correla...
<python><opencv><computer-vision>
2025-04-13 16:10:52
1
3,629
Mike B
79,571,701
10,024,860
asyncpg when to use get a new connection with pool.acquire vs share one connection
<p>I'm wondering when to share a asyncpg connection vs create a new one. Suppose I have:</p> <pre><code>async def monitor(data_stream): # ... while True: # ... x, y = await data_stream.get_data() await conn.execute(&quot;INSERT INTO table (x, y) VALUES ($1, $2)&quot;, x, y) await...
<python><database><asyncpg>
2025-04-13 15:14:04
0
491
Joe C.
79,571,647
6,346,482
Visualise colour gradient based on histogram
<p>I feel like this is more of a math question. I have a programme which visualises distances and then draws them on a map, based on the hue spectre. The problem is that the distance values are not equally distributed and therefore, I only see a few colours of the spectre and it gets quite boring.</p> <p>Attached as ph...
<python><colors><histogram>
2025-04-13 14:18:03
1
804
Hemmelig
79,571,602
2,278,546
Plugging SciPy's Nelder-Mead result back into the function does not return reported result
<p>When I take the <code>x</code> reported by the optimization and plug it back into my function <code>optimizee</code>, I don't get the value outputted by the optimization: -749.260. Rather I get -637.65, which is not as good...</p> <p>I'm using SciPy's Nelder-Mead to optimize a nasty function I have put together:</p>...
<python><optimization><scipy>
2025-04-13 13:35:44
1
505
grasswistle
79,571,481
439,203
Get current function name
<p>Executing</p> <pre><code>vscode.executeDocumentSymbolProvider </code></pre> <p>gives me all symbols in the file.</p> <p>Can I somehow get name of the function that the cursor is currently in?</p>
<python><vscode-extensions><vscode-python>
2025-04-13 11:21:58
1
1,151
mike27
79,571,478
17,396,945
Loguru timed rotation keeps creating log files on every application startup
<p>So, I tryed to use loguru as main logging utility in my django project, mainly because of cool and simple file logs rotations implementation. My logger configurations looks something like this:</p> <pre class="lang-py prettyprint-override"><code>from loguru import logger logger.configure( handlers=[ { ...
<python><loguru>
2025-04-13 11:20:56
1
499
Олексій Холостенко
79,571,318
5,224,341
How to know if a Python package (e.g., ipykernel) is preinstalled on macOS — and whether it's safe to uninstall?
<p>I'm using macOS and working on a Python project with a virtual environment (<code>venv</code>) in VS Code. At one point, VS Code prompted me to install <code>ipykernel</code>, and I accidentally clicked &quot;Install&quot; — but only later realized that the selected interpreter wasn't my <code>venv</code>. So <code>...
<python><macos><pip>
2025-04-13 07:54:26
1
522
vlangen
79,571,068
2,398,193
How to read a .csv file in a Quarto Shinylive application?
<p>This code below works when doing <code>quarto preview</code> in the terminal. So, the chunk is of type shinylive-python.</p> <pre><code>```{shinylive-python} #| standalone: true #| layout: vertical #| viewerHeight: 250 from shiny import * app_ui = ui.page_fluid( ui.input_slider(&quot;n&quot;, &quot;N&quot;, 0,...
<python><quarto><py-shiny><py-shinylive>
2025-04-13 00:12:58
1
477
Jorge Lopez
79,571,015
962,212
Gradio "AttributeError: 'Image' object has no attribute 'proxy_url'"
<p>Since the Gradio Discord server is busy or does not allow new requests, I'm posting this here. I intend to display an image in the rows of a Gradio Dataset. The error is &quot;AttributeError: 'Image' object has no attribute 'proxy_url'&quot; and seems deep in the implementation of Gradio, so the AI did not help to u...
<python><gradio>
2025-04-12 22:46:15
1
302
Veronica
79,571,010
219,153
How to create a NumPy structured array with different field values using full_like?
<p>I would like to create a NumPy structured array <code>b</code> with the same shape as <code>a</code> and <code>(-1, 1)</code> values, for example:</p> <pre><code>import numpy as np Point = [('x', 'i4'), ('y', 'i4')] a = np.zeros((4, 4), dtype='u1') b = np.full_like(a, fill_value=(-1, 1), dtype=Point) # fails b = n...
<python><numpy><structured-array>
2025-04-12 22:39:24
2
8,585
Paul Jurczak
79,570,945
740,521
Why is stdout PIPE readline() not waiting for a newline character?
<p>Why is <code>print(line)</code> in <code>read_stdout</code> printing every character instead of the entire line? I am expecting it to add to the queue once the newline character is reached, but it's just putting every character in the queue instead.</p> <p><code>plugin_test.py</code>:</p> <pre><code>from subprocess ...
<python><io><subprocess>
2025-04-12 21:11:27
1
1,206
user740521
79,570,775
417,896
Invalid Authority - OKX Bitcoin API
<p>I am getting Invalid Authority error when running this code to pull data from OKX. I have confirmed the env vars are correct.</p> <p>I think it is something with the signature.</p> <pre><code>def generate_signature(timestamp, method, request_path, body, secret_key): message = f'{timestamp}{method.upper()}{reque...
<python>
2025-04-12 17:53:43
1
17,480
BAR
79,570,460
1,549,736
Why does mlx.core.sqrt() crash on my MacBook Air M2 when applied to a complex argument?
<p><code>mlx.core.sqrt()</code> is crashing on my MacBook Air M2 when applied to a complex argument:</p> <pre class="lang-bash prettyprint-override"><code>Python 3.11.11 (main, Dec 3 2024, 17:20:40) [Clang 16.0.0 (clang-1600.0.26.4)] on darwin Type &quot;help&quot;, &quot;copyright&quot;, &quot;credits&quot; or &quot;...
<python><gpu><metal><apple-m2><mlx>
2025-04-12 12:44:13
1
2,018
David Banas
79,570,287
577,288
python 3 - concurrent.futures - get thread number without adding a function
<p>Currently this code prints,</p> <pre><code>MainThread done at sec 1 MainThread done at sec 1 MainThread done at sec 2 MainThread done at sec 1 MainThread done at sec 0 MainThread done at sec 3 MainThread done at sec 2 MainThread done at sec 5 MainThread done at sec 4 </code></pre> <p>I need it to print</p> <pre><cod...
<python><multithreading><concurrent.futures>
2025-04-12 10:03:03
1
5,408
Rhys
79,570,163
16,383,578
Why do these nearly identical functions perform very differently?
<p>I have written four functions that modify a square 2D array in place, it reflects half of the square array delimited by two sides that meet and the corresponding 45 degree diagonal, to the other half separated by the same diagonal.</p> <p>I have written a function for each of the four possible cases, to reflect <cod...
<python><arrays><numpy><numba>
2025-04-12 07:38:21
1
3,930
Ξένη Γήινος
79,569,998
2,001,654
Get the QColor at an arbitrary position within the 0-1 range of a QGradient
<h2>Objective</h2> <p>I want to get the <em>visual</em> color at an arbitrary position within the <code>0.0</code>-<code>1.0</code> range of any given QGradient.</p> <p>This may be necessary to properly compute new intermediate stops between existing ones, or to get a color at a specific point in order to use it as a d...
<python><c++><qt><gradient><qcolor>
2025-04-12 03:39:27
0
49,772
musicamante
79,569,982
6,457,407
How do I unittest an HTML page that contains an embedded dynamic image?
<p>I've got an dynamic HTML page that contains a QR code that is generated dynamically and embedded using <code>&lt;img src=data:image/png:....&gt;</code>. I had been testing the page by generating it with specific arguments and verifying that it matches the output I expect.</p> <p>I'm now discovering that the embedded...
<python><html><unit-testing><png>
2025-04-12 03:09:27
2
11,605
Frank Yellin
79,569,792
9,441,040
Pickle works but fails pytest
<p>I've created a module persist containing a function obj_pickle which I'm using to pickle various objects in my project. It work fine but it's failing pytest, returning;</p> <pre><code>&gt; pickle.dump(obj, file_handle, protocol=protocol) E AttributeError: Can't pickle local object 'test_object.&l...
<python><pytest><pickle>
2025-04-11 22:30:33
2
362
Paul C
79,569,771
6,615,517
Not able to import module after adding folder to path
<p>I am trying to import a module based on this RDKit blog: <a href="https://greglandrum.github.io/rdkit-blog/posts/2023-12-01-using_sascore_and_npscore.html" rel="nofollow noreferrer">https://greglandrum.github.io/rdkit-blog/posts/2023-12-01-using_sascore_and_npscore.html</a> but it won't work if I try to include it i...
<python><rdkit>
2025-04-11 22:03:25
1
342
rwalroth
79,569,591
2,410,605
First Attempt at Downloading a Google Sheet using Python Selenium, Getting a 401 Authentication Error
<p>I need to programmatically download a Google Sheet as a csv file and I'm trying to use Python Selenium to accomplish this. Unfortunately I'm receiving a 401 error on the authentication.</p> <p>Here's my code:</p> <pre><code>import os import logging import requests import sys from google.auth.transport.requests impo...
<python><google-sheets><google-cloud-platform>
2025-04-11 19:30:42
1
657
JimmyG
79,569,505
10,917,549
Load DeepSeek-V3 model from local repo
<p>I want to run the DeepSeek-V3 model inference using the Hugging-Face Transformer library (&gt;= v4.51.0).</p> <p>I read that you can do the following to do that (download the model and run it)</p> <pre><code>from transformers import pipeline messages = [ {&quot;role&quot;: &quot;user&quot;, &quot;content&quot;: &qu...
<python><huggingface-transformers><huggingface><deepseek>
2025-04-11 18:26:42
1
409
The_Average_Engineer
79,569,500
12,276,279
How can I sort order of index based on my preference in multi-index pandas dataframes
<p>I have a pandas dataframe <code>df</code>. It has multi-index with Gx.Region and Scenario_Model. The Scenario_Model index is ordered in alphabetical order des, pes, tes. When I plot it, it comes in the same order. However, I want to reorder it as pes, tes and des, and plot it accordingly. Is it possible to achieve i...
<python><python-3.x><pandas><dataframe><indexing>
2025-04-11 18:23:33
1
1,810
hbstha123
79,569,466
3,225,072
Launching audacity from Python and loading multiple audios
<p>I'm trying to write a python script which loads Audacity with multiple audio files in the same window. So far I have been able to do this but instead of opening both audio files on the same window, 2 independent Audacity windows are opened , one for each audio file.</p> <p>Is there a way to get both audios to load o...
<python><subprocess><audacity>
2025-04-11 17:58:05
2
960
Victor
79,569,354
12,276,279
For multi-index columns in pandas dataframe, how can I group index of a particular level value for visualization in Python?
<p>I have a pandas dataframe which is basically a pivot table.</p> <p><code>df.plot(kind = &quot;bar&quot;,stacked = True)</code> results in following plot. The labels in x-axis are congested as shown. <a href="https://i.sstatic.net/c9qRrDgY.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/c9qRrDgY.png" a...
<python><matplotlib><pivot><xticks>
2025-04-11 16:46:53
2
1,810
hbstha123
79,569,195
1,700,890
Pandas - group by and filter
<p>Here is my dataframe</p> <pre><code>my_df = pd.DataFrame({'col_1': ['A', 'A', 'B', 'B', 'C', 'C'], 'col_2': [1, 2, 1, 2, 1, 2]}) </code></pre> <p>I would like to group by <code>col_1</code> and filter out anything strictly greater than one using <code>col_2</code>. The final result should ...
<python><pandas><filter><group-by>
2025-04-11 15:17:16
1
7,802
user1700890
79,569,161
393,896
How to create json content object where some of the content will be prefixed and suffixed with backslash and doublequote \"
<p>I have following python code:</p> <pre><code>import json data = {&quot;name&quot;: &quot;John&quot;, &quot;age&quot;: 30, &quot;city&quot;: &quot;New York&quot;} print(data) json_string = json.dumps(data, indent=4) print(json_string) json_string_escaped = json_string.replace('&quot;','\\&quot;') print(json_string_e...
<python><replace>
2025-04-11 15:04:29
1
994
Ladislav Zitka
79,569,154
1,898,534
Databricks Cluster Initi Script: Multiple global.extra-index-url
<p>I'm using a Databricks init script to configure Python package indexes via AWS CodeArtifact. The script fetches an auth token and then sets the index-url and extra-index-url using pip config --global set ....</p> <p><strong>Here's the relevant snippet:</strong></p> <pre class="lang-bash prettyprint-override"><code>p...
<python><pyspark><pip><databricks>
2025-04-11 15:00:49
0
6,499
PlagTag
79,569,029
1,735,914
Python ElementTree iter() method using XPath
<p>I have the following XML element:</p> <pre><code>&lt;Content&gt; &lt;Controller Use=&quot;Context&quot; Name=&quot;Base_Project_Maximum_Connections&quot;&gt; &lt;DataTypes Use=&quot;Context&quot;&gt; &lt;DataType Use=&quot;Target&quot; Name=&quot;cs_dint&quot; Family=&quot;NoFamily&quot; Class=&quot;User...
<python><xpath><elementtree>
2025-04-11 14:07:13
1
2,431
ROBERT RICHARDSON
79,568,962
12,276,279
Aligning matplotlib subplots one with stacked bar plot and another with line plot using matplotlib in Python
<p>I have 2 dataframes as follows: <code>df1.to_dict()</code> results in</p> <pre><code>{'Peak Demand PES': {2023: 124126.91, 2025: 154803.41, 2030: 231494.66, 2040: 483217.66000000003, 2050: 1004207.86}, 'Peak Demand TES': {2023: 125724.8, 2025: 142959.13999999998, 2030: 186044.99000000002, 2040: 288307...
<python><python-3.x><matplotlib><bar-chart><subplot>
2025-04-11 13:36:25
1
1,810
hbstha123
79,568,961
16,383,578
Why does this fast function with Numba JIT slow down if I JIT compile another function?
<p>So I have this function:</p> <pre><code>import numpy as np import numba as nb @nb.njit(cache=True, parallel=True, nogil=True) def triangle_half_UR_LL(size: int, swap: bool = False) -&gt; tuple[np.ndarray, np.ndarray]: total = (size + 1) * size // 2 x_coords = np.full(total, 0, dtype=np.uint16) y_coords...
<python><windows><numpy><numba>
2025-04-11 13:35:57
1
3,930
Ξένη Γήινος
79,568,862
1,073,410
Python dataclasses, inheritance and alternate class constructors
<p>In Python, I am using <code>dataclass</code> with the following class hierarchy:</p> <pre class="lang-py prettyprint-override"><code>from dataclasses import dataclass @dataclass class Foo: id: str @classmethod def fromRaw(cls, raw: dict[str, str]) -&gt; 'Foo': return Foo(raw['id']) @dataclass class Bar(...
<python><python-dataclasses>
2025-04-11 12:36:53
1
1,487
hvtilborg
79,568,585
1,182,469
Running poetry in using jenkins dockerfile
<p>I've got my dockerfile</p> <pre><code>FROM git.corp.com:4567/some/python:3.11-slim RUN apt update; \ apt install pipx -y; \ pipx install poetry; \ pipx ensurepath; \ chmod a +rx /root/.local/bin/poetry; \ ln -s /root/.local/bin/poetry /usr/bin/poetry; \ </code></pre> <p>and my jenkins stage</p> <pre><cod...
<python><linux><docker><jenkins><python-poetry>
2025-04-11 10:15:35
1
3,146
xander27
79,568,474
2,123,706
replace non zero result with 1 using a lambda function python
<p>I am calculating a binary result of whether or not values in columns have at least one match. It may chance that they have multiple matches. I want to return a result of 1 if they have &gt;1 common value.</p> <p>MRE below:</p> <pre><code>df=pd.DataFrame({'col1':['a|b|c','a|b|c','a|b|c'],'col2':['b|d|e|a','d|e|f','a'...
<python><pandas><lambda>
2025-04-11 09:18:41
2
3,810
frank
79,568,436
4,235,960
Python Web Parsing - Avoid getting redirected to a local version of the website
<p>I am using the following code to parse websites:</p> <pre class="lang-py prettyprint-override"><code>from selenium import webdriver from selenium.webdriver.common.by import By from selenium.webdriver.chrome.options import Options import time from urllib.parse import urlparse from bs4 import BeautifulSoup import requ...
<python><selenium-webdriver><parsing><beautifulsoup>
2025-04-11 09:01:38
2
3,315
adrCoder
79,568,360
17,040,989
determine position of an inserted string within another
<p>Following <a href="https://stackoverflow.com/questions/79562059/how-to-randomly-add-a-list-of-sequences-into-a-text-body">this post</a> I managed to put together a small function to place within a bigger text body (FASTA) shorter strings determined from another file based on some conditions (<em>e.g.</em> 100 events...
<python><string><bioinformatics><biopython><fasta>
2025-04-11 08:22:05
1
403
Matteo
79,568,299
8,303,802
Executing and retrieving stored procedure returns in python with oracle db
<p>I am trying to run</p> <pre><code> plsql = &quot;&quot;&quot; DECLARE l_zip BLOB; BEGIN l_zip := apex_export.zip( p_source_files =&gt; apex_export.get_workspace(:1), p_extra_file...
<python><python-3.x><oracle-database><oracle-apex><python-oracledb>
2025-04-11 07:49:34
1
630
Sourabh
79,568,097
11,484,423
Python static class variable in nested class
<p>I have a nested class that uses static vars to have class wide parameters and accumulators.</p> <p>If I do it as a standalone class it works.</p> <p>If I do a nested class and inherit the standalone class, it works.</p> <p>But I can't get a nested class to have static class variables, the interpreter gets confused. ...
<python><inner-classes><static-variables>
2025-04-11 06:00:18
1
670
05032 Mendicant Bias
79,568,068
4,473,615
Extract specific dictionary value from dataframe in PySpark having case insensitive attributes
<p>I have a below dataframe</p> <pre><code>dataDictionary = [('value1', [{'key': 'Fruit', 'value': 'Apple'}, {'key': 'Colour', 'value': 'White'}]), ('value2', [{'key': 'Fruit', 'value': 'Mango'}, {'key': 'Bird', 'value': 'Eagle'}, {'key': 'Colour', 'value': 'Black'}]), ('value3', [{'key': 'Fruit', 'va...
<python><pyspark><lambda>
2025-04-11 05:36:29
1
5,241
Jim Macaulay
79,567,933
16,686,130
Using a class property as an iterable produces a reassign warning
<p>I need to use an iterable and a loop variable as a class property. But the flake8 checker produces B2020 warning:</p> <pre><code>easy.py:11:13: B020 Found for loop that reassigns the iterable it is iterating with each iterable value. </code></pre> <p>If I use a variable for iterable there is OK.</p> <p>What is wrong...
<python><python-3.x><flake8>
2025-04-11 03:26:06
1
608
Sergey Zaykov
79,567,641
6,386,632
Filter a dict, keeping only certain keys, and applying defaults where they are missing
<p>In Python, I have a dict (called <code>params</code>) containing a variable list of params. I want a function to return this dict with only certain keys kept, and default values applied if these keys are missing in the first dict.</p> <p>E.g.</p> <pre class="lang-py prettyprint-override"><code>params = {'a':1,'b':2,...
<python>
2025-04-10 22:02:57
6
2,034
phhu
79,567,480
8,284,452
How to select from xarray.Dataset without hardcoding the name of the dimension?
<p>When selecting data from an xarray.Dataset type, <a href="https://docs.xarray.dev/en/latest/user-guide/indexing.html#quick-overview" rel="nofollow noreferrer">the examples they provide</a> all include hardcoding the name of the dimension like so:</p> <pre class="lang-py prettyprint-override"><code>ds = ds.sel(state_...
<python><python-xarray><netcdf><netcdf4>
2025-04-10 19:54:16
1
686
MKF
79,567,429
14,298,880
Duplicate and rename columns on pandas DataFrame
<p>I guess this must be rather simple, but I'm struggling to find the easy way of doing it.</p> <p>I have a pandas DataFrame with the columns A to D and need to copy some of the columns to new ones. The trick is that it not just involves renaming, I also need to duplicate the values to new columns as well.</p> <p>Here ...
<python><pandas><dataframe>
2025-04-10 19:24:58
1
1,553
Ralubrusto
79,567,168
11,062,613
How can I get LLVM loop vectorization debug output in Numba?
<p>I'm trying to view LLVM debug messages for loop vectorization using Numba and llvmlite. I want to see the loop vectorization &quot;LV:&quot; debug output (e.g., messages like LV: Checking a loop in ...) so I can analyze the vectorization decisions made by LLVM. <a href="https://numba.readthedocs.io/en/stable/user/fa...
<python><linux><llvm><numba><llvmlite>
2025-04-10 16:31:05
1
423
Olibarer
79,567,094
2,618,676
My testing loss isn't improving while I'm using same train and test data
<p>I'm trying to fine tune a model for a segmentation task. To see if everything is working properly I'm trying to make my model overfit on a single image split in 16 different patches. <br> So in my code, I tried using the exact same dataLoader for my training and testing. <br> What I don't understand is that my train...
<python><tensorflow><loss-function><dice>
2025-04-10 15:48:27
0
331
Antoine
79,567,079
16,011,842
Posting to API with cURL works while Python requests fails
<p>I have a cURL command that works when uploading a file while the equivalent Python requests fails.</p> <p>Here is the cURL command</p> <pre><code>curl -X POST &quot;http://&lt;DOMAIN&gt;/polarion/rest/v1/projects/&lt;PROJECT_ID&gt;/workitems/&lt;WORKITEM_ID&gt;/attachments&quot; \ -H &quot;Authorization: Bearer &l...
<python><curl><python-requests><polarion>
2025-04-10 15:41:29
1
329
barneyAgumble
79,567,052
2,123,706
how to search for multiple substrings in a column using polars
<p>In pandas, I can search for multiple different substrings in a column, and determine which rows they can be found in. How can I do this in polars?</p> <p>my pandas code:</p> <pre><code>df = pd.DataFrame({'col1':['a red','dog','liked to play','with his best friend','the CAT']}) ls = ['best','dog'] df[df.col1.str.cont...
<python><dataframe><contains><python-polars>
2025-04-10 15:25:32
0
3,810
frank
79,567,049
5,100,278
I have installed selenium 4.31, but Selenium Manager is not picking up the chrome driver
<p>I have a Python project. I installed selenium as <code>pip install -U selenium</code>. When I run <code>pip show selenium</code>, it outputs: <code>Name: selenium Version: 4.31.0</code></p> <p>However, when I run this simple code <code>script.py</code>:</p> <pre><code>from selenium import webdriver driver = webdriv...
<python><selenium-webdriver>
2025-04-10 15:24:57
2
10,216
Kingamere
79,566,952
1,406,168
How to authenticate a Python package between two repos in GitHub and deploy
<p>We have a private utility repo in GitHub and we would like to be able to install this package with a GitHub Actions. When developing locally I have created a ssh key, uploaded the public key to deploy keys in GitHub, and everything works fine locally.</p> <p><code>requirements.txt</code>:</p> <pre><code>annotated-ty...
<python><azure><github><github-actions><ssh-keys>
2025-04-10 14:34:35
1
5,363
Thomas Segato
79,566,873
4,451,521
Why is Swagger UI not handling optional files properly?
<p>I have a minimal example in this script:</p> <pre class="lang-py prettyprint-override"><code>from fastapi import FastAPI, File, Form, UploadFile from typing import Optional from fastapi.responses import JSONResponse app = FastAPI() @app.post(&quot;/evaluate&quot;) async def evaluate( server_id: str = Form(...)...
<python><swagger><fastapi><swagger-ui>
2025-04-10 14:01:57
0
10,576
KansaiRobot
79,566,786
2,350,145
How to create nicegui table in sideways manner?
<p>I want to have a nicegui table in sideways (3x3) like below</p> <p><a href="https://i.sstatic.net/FyHcR1mV.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/FyHcR1mV.png" alt="3x3 table" /></a></p> <p>I am using this code but it is not giving as expected</p> <pre class="lang-py prettyprint-override"><co...
<python><python-3.x><nicegui>
2025-04-10 13:30:07
1
5,808
Anirban Nag 'tintinmj'
79,566,761
2,266,881
Sort a polars dataframe based on an external list
<p>Morning,</p> <p>I'm not sure if this can be achieved..</p> <p>Let's say i have a polars dataframe with cols a, b (whatever).</p> <pre class="lang-py prettyprint-override"><code>import polars as pl df = pl.from_repr(&quot;&quot;&quot; ┌─────┬─────┐ │ a ┆ b │ │ --- ┆ --- │ │ i64 ┆ str │ ╞═════╪═════╡ │ 1 ┆ x ...
<python><dataframe><python-polars><polars>
2025-04-10 13:19:01
2
1,594
Ghost
79,566,403
8,037,521
Problems going between maximized and sidebar-only window
<p>I have a specific situation where I do not understand how QT works and what is specifically wrong here. Below I describe two observable issues but I suppose that they follow from same underlying mistake in code.</p> <p>My goal:</p> <ol> <li>Have app with left and right side. Left always visible, right can be hidden....
<python><qt><user-interface><pyside6><window-resize>
2025-04-10 10:38:12
0
1,277
Valeria
79,566,384
2,277,833
Running Django tests ends with MigrationSchemaMissing exception
<p>I'm writing because I have a big problem. Well, I have a project in Django where I am using django-tenants. Unfortunately, I can't run any tests as these end up with the following error when calling migrations: ‘django.db.migrations.exceptions.MigrationSchemaMissing: Unable to create the django_migrations table (no ...
<python><django><python-unittest>
2025-04-10 10:29:00
2
364
Draqun
79,566,109
10,827,766
Partial hypothesis examples
<p>Is it in any way possible to provide partial <code>examples</code>, such as in the following case, where <code>b</code> is missing from the example decorator?</p> <pre class="lang-py prettyprint-override"><code>@given(a=st.integers(), b=st.integers()) @example(a=0) def test_example(a, b): ... </code></pre> <p>He...
<python><python-hypothesis>
2025-04-10 08:25:44
2
409
syvlorg
79,565,983
6,839,733
How to update an existing enrollment in Azure DPS?
<p>I'm having a really hard time trying to update an existing enrollment in Azure DPS, ie. in the event of having lost the symmetric keys and generating new ones to be added to the existing enrollment.</p> <p>From what I see in the Azure examples, this <em>should</em> work. But it doesn't. I'm still getting error 40920...
<python><azure><azure-iot-hub>
2025-04-10 07:23:10
1
1,332
Oystein
79,565,937
6,862,601
Click help text shows 'dynamic' when an option has the default set to a lambda
<p>I have this code in a CLI:</p> <pre><code>@click.option( &quot;--username&quot;, default=lambda: os.environ.get(&quot;USER&quot;, None), show_default=True, help=&quot;User name for SSH configuration.&quot;, ) </code></pre> <p>When I invoke the CLI with <code>--help</code> option, I get this:</p> <pre...
<python><python-click>
2025-04-10 07:01:49
1
43,763
codeforester
79,565,827
14,098,258
how to recover from error "Cannot mix incompatible Qt library (6.8.3) with this library (6.8.2)"
<p>I am using a conda virtual environment. I ran my code yesterday and it worked perfectly fine.</p> <p>I changed <strong>NOTHING</strong> in my code. I changed <strong>NOTHING</strong> in my virtual environment.</p> <p>Now I run the code again and get the following error: <code>Process finished with exit code -1073740...
<python><qt><matplotlib><conda>
2025-04-10 05:57:26
1
383
Andre
79,565,707
2,746,878
ValueError: PandasEngine works only with pd.DataFrame input data
<p>python version 3.9.21</p> <p>define ref dataset</p> <pre><code>tr_ds_lr = Dataset.from_pandas( tr_data_lr, data_definition=DataDefinition() ) </code></pre> <p>define cur dataset</p> <pre><code>te_ds_lr = Dataset.from_pandas( te_data_lr, data_definition=DataDefinition() ) </code></pre> <p>defining rep...
<python><evidently>
2025-04-10 04:11:45
0
1,096
Neel Kamal
79,565,611
1,440,565
Troubleshoot "Invalid input shape for input Tensor"
<p>I am trying to build a model with keras and tensorflow to play Go:</p> <pre><code> training_data = encode_from_file_info(training_files) testing_data = encode_from_file_info(testing_files) input_shape = (1, 19, 19) model = Sequential( [ keras.layers.Input(input_shape), ...
<python><tensorflow><keras>
2025-04-10 02:00:16
1
83,954
Code-Apprentice
79,565,605
5,091,805
pyright can't resolve imports in modules with their own pyproject.toml
<p>Working with a mono-repository structured as so:</p> <pre class="lang-none prettyprint-override"><code>- pyproject.toml (root workspace, references other members) src ├── application │   └── service.py ├── domain │   ├── headroom │   │   └── service.py │   ├── hosting_capacity │   │   └── service.py │   ├── model_fr...
<python><pyright>
2025-04-10 01:55:25
1
6,289
Ari
79,565,565
350,878
python script fails to accept keyboard input, win 11, gitbash
<p>Here is a script that try to capture human play and later feed to a train script. I found that is not able to accept keyboard input, win 11, gitbash. using window native cmd, also has same problem. Any idea how to fix it?</p> <pre><code> print(&quot;🕹️ KUNG FU MASTER TRAINER CONTROLS:&quot;) print(&q...
<python><input><keyboard>
2025-04-10 01:16:24
1
8,376
kenpeter