2,204,850 questions
Score of -3
0 answers
45 views
How can i improve the readability and python style of certain problems? [closed]
im learning python and practicing sliding window problems. I wrote the following solution to count subarrays of size k whose average is greater than or equal to a given threshold:
def ...
Score of 0
0 answers
62 views
Can't get virtual environment to activate from the terminal [duplicate]
I am trying to run a Python script using a venv I created with PyCharm. When I run the script using PyCharm, the script runs fine. When I try to run it from the terminal, I get "module not found&...
Score of 0
1 answer
36 views
GStreamer later version seems to mis-identify the prepare-window-handle message
We had some Python code that was working fine with GStreamer 1.26 but appears broken in 1.28.
The code is in the bus sync handler where we expect the prepare-window-handle from our xvimagesink sink to ...
Score of -3
1 answer
146 views
Python script to download Barchart data is no longer working
The Python script in the answer to Automatic file downloading on Barchart.com using python is no longer working. This script was working a few days ago.
# Source - https://stackoverflow.com/a/66753863
...
Score of -5
0 answers
135 views
Python code to convert .tdms to .csv or .xlsx [closed]
i have made a python code to check a folder for completed .tdms files, copy file to new folder , hash check then delete original file. it then looks at certain channels inside that data and renames ...
Score of 4
3 answers
126 views
Delete operation on frozendict
I'm trying to work with the new Python 3.15/PEP-814 frozendict. The new type has operations to add and update values using the union operator. This always returns a new frozendict, which is expected ...
Score of -10
0 answers
50 views
Writing lines as a single string from other file [duplicate]
Iam reading a specific number of lines from a file and writing that onto another file but we have to write all these lines as a single string all the next lines should come in a single string python ...
Score of -3
0 answers
65 views
How can I efficiently store and retrieve multi-temporal satellite raster data on a low-storage offline system? [closed]
I'm working on a project using Sentinel-2 satellite imagery for areas like Chennai, Bengaluru and Mumbai.
I need to store satellite observations from multiple years and later:
Read specific bands (...
Score of -1
0 answers
71 views
Visual Studio Code does not show descriptions of ManyToManyField set and clear
Listing has many items through ManyToManyField.
class Listing(models.Model):
# Properties
items = models.ManyToManyField(Item, related_name="listings", blank=True)
When I hover over ...
Score of 3
1 answer
97 views
How do I make my QMainWindow's contents dynamically resize after floating a QDockWidget?
I managed to boil the problem down to a single example:
from PySide6.QtCore import Qt
from PySide6.QtWidgets import QApplication, QDockWidget, QLabel, QMainWindow, QPushButton
class MainWindow (...
Score of 0
1 answer
70 views
Tkinter Canvas create_image() method not working [duplicate]
I have a program thats meant to make a default chess position
all the PNGs are 60x60, they are the 12 chess pieces found on WikiMedia commons at https://commons.wikimedia.org/wiki/Category:...
Score of -4
0 answers
58 views
Why does NumPy slicing with a positive step return an empty array when start index is greater than end index? [duplicate]
I am learning NumPy slicing and I am confused about why this slice returns an empty array:
import numpy as np
array = np.array([
[1, 2, 3, 4, 5],
[6, 7, 8, 9, 10],
[11, 12, 13, 14, 15],
...
Score of -4
0 answers
80 views
Why Does an Identity Comparison Using id() Evaluate to False? [duplicate]
x = 256
y = 256
id(x) is id(y)
False
id(x)
94588034274160
id(y)
94588034274160
I'm trying to figure out what is going on here. Could it be that the identity operator is separately checking the ...
Score of 2
1 answer
122 views
How to resolve TypeError: isSubclass() arg 1 must be a class when issubclass() wasn't explicitly called? [closed]
I am trying to resolve an issue regarding one of the files regarding a bot I'm working on. Whenever I attempt to load this specific gear which acts as extra functions related to levelling for my bot, ...
Score of 3
1 answer
86 views
Using ast.parse to evaluate arithmetic expression safely [closed]
_OPS = {
ast.Add: operator.add, ast.Sub: operator.sub, ast.Mult: operator.mul,
ast.Div: operator.truediv, ast.Pow: operator.pow, ast.USub: operator.neg,
ast.UAdd: operator.pos, ast.Mod: ...