2,209,251 questions
0
votes
0
answers
9
views
Python exec and Git's worktree lifecycle
I'm encountering a peculiar issue when using Python's exec function within scripts that are run across different Git worktrees. Specifically, I've observed that the behavior of exec (and by extension, ...
Advice
0
votes
1
replies
20
views
Best resources to learn Data Structures, Algorithms, and Big-O from scratch (for Python)
I want to learn Data Structures, Algorithms, and Big-O notation from scratch, but there are too many resources online and it’s difficult to determine which ones are trustworthy or widely used by ...
0
votes
0
answers
14
views
Cannot create Azure Blob Storage linked service for Synapse using SDK
I am attempting to use the Python SDK to create a linked service to an Azure Blob Storage account in my Synapse Workspace.
I have some code which creates a dictionary whose structure matches exactly ...
0
votes
0
answers
23
views
FastHtml import JPG from custom package
I have a custom Python package, that serves as a layout for my FastHtml page. It includes some minor JPEGs, which cannot be found in my FastHtml app (from where I consume the package):
from fasthtml....
-1
votes
1
answer
41
views
Pandas 'sep' Command Not Working for Text File
I have the following (shortened) list of data (State Vector for an arbitrary satellite):
0.0000000000000000e+00 6.0513311190355308e+06 -2.3889553726207524e-10 -3.9014601994371545e+06 4....
0
votes
0
answers
30
views
How to destroy Tkinter windows from external script?
I have a script called GUI running two tkinter windows and I've been able to kill my program from within the script by creating a function for it
def gui_kill():
root.destroy()
win.destroy()
...
-2
votes
0
answers
29
views
RapidOCR does not return the expected value [closed]
When I directly run the code, it returned normally. But when i run it through shortcut, the file text.txt has no change.
#!/usr/bin/env python3
from rapidocr_onnxruntime import RapidOCR
import opencc
...
-7
votes
0
answers
51
views
I am confused using Reg-Ex for looking specific conditions in strings [closed]
This is the thing I don't get. The regex part where I don't get how is it formed the regex and how can I understand the logic. I have been looking for "conditions" but for a single thing ...
0
votes
1
answer
42
views
How to create an optional value that user cannot set to None, but with default None value?
I can't find reliable information for Pydantic v2 and optional non-nullable field. I have something like:
from pydantic import BaseModel
class UpdateRequest(BaseModel):
foo: str = None
I want ...
Advice
0
votes
3
replies
20
views
Name collision between files in as content root source added projects in Pycharm
When I add a project as content source root in Settings/Project Structure, I can use all functions from that project in my current project, so this works fine. The problem arises if there are two ...
Best practices
0
votes
1
replies
24
views
How to extract contours for each stacked bag (web sling) in a depth image using OpenCV?
I’m working on an image-processing task in Python/OpenCV and I’m stuck on how to segment each “web sling” (stacked bag group) as an individual contour.
What I’m trying to achieve:
Detect each web ...
-4
votes
0
answers
41
views
I want to replace some value of colum to none [closed]
I have a big data set of retailers
In which a column quantity and quality
I want to replace or change the some values of these column with None value
I am order such as 1 value same and 3 value same 6 ...
-4
votes
0
answers
51
views
Why is my Python program not writing all lines to a file when using w mode? [closed]
I'm trying to write multiple lines to a file in Python:
f = open("data.txt", "w")
f.write("Hello\n")
f.write("World\n")
f.write("Test\n")
f.close()
...
0
votes
0
answers
18
views
PyInstaller .exe crashes silently when loading AI model
I'm trying to use OpenAI's Whisper model to write a speech-to-text app. When I run the script in PyCharm everything works perfectly. However, when I run the .exe generated by PyInstaller, it silently ...
Best practices
0
votes
0
replies
21
views
Pickling error work-around when passing decorated functions to multiprocessing module?
I use the "decorator" idea as way to parameterize functions, but ran into pickling errors when passing these functions as targets to the multiprocessing module. I found a work-around by ...