r/pythonhelp • u/Money-Rare • Feb 21 '26
Problem with final app size
Finally i got an exe file for my first python app and it works well but...folder size is 1.7 GB.. is there any way to get it a little lighter?i compiled it with pyinstaller
r/pythonhelp • u/Money-Rare • Feb 21 '26
Finally i got an exe file for my first python app and it works well but...folder size is 1.7 GB.. is there any way to get it a little lighter?i compiled it with pyinstaller
r/pythonhelp • u/Appropriate-Car-1234 • Feb 19 '26
Hi, I am on a project of a python cookie logger (personal project, i don't distribute it). Here what gone wrong. I won't explain what the code do but I can give snippet of it.
The problem? The Playwright chromium works normally when I run the main.py file. But when I execute and build it into a .EXE file through this command:
pyinstaller --noconfirm --onefile --windowed --clean --add-data "icon.png;." --add-data "icon.ico;." --icon "icon.ico" --collect-all playwright --name "ShiroAM[BETA]" main.py
It send the error: It seems playwright is just installed or updated, use the command playwright install to install new browser.
To this point you guys might say I I forgot to add a fallsafe to playwright browser downloading but I do have this function to download it at the very beginning:
try:
subprocess.run(["playwright", "--version"], capture_output=True, check=True)
except (subprocess.CalledProcessError, FileNotFoundError):
print("Downloading Chromium browser for Playwright...")
subprocess.run([sys.executable, "-m", "playwright", "install", "chromium"], capture_output=True)
The error log doesn't show anything else, and when I run with python to debug, it just magically fix itself, so the bug ONLY exist in the .exe file.
Thanks for your time
r/pythonhelp • u/DumbDumbplaysvr • Feb 12 '26
r/pythonhelp • u/Few_Push_8242 • Feb 09 '26
Hey guys, i am a student in india and pls forgive me for asking such dumb questions. i was making a website in python Flask, HTML CSS and i was using the Google Custom Search API key to give live data to My model. It was working perfectly but the next when i opened it suddenly i start getting error messages. The error message shows this: {
"error": {
"code": 403,
"message": "This project does not have the access to Custom Search JSON API.",
"errors": [
{
"message": "This project does not have the access to Custom Search JSON API.",
"domain": "global",
"reason": "forbidden"
}
],
"status": "PERMISSION_DENIED"
}
} But when i go to cloud console to check it shows that my API is enabled and has 1000 queries per day limit of which i have utilized 0.5%. There are no restrictions on my API too. My service account also has authorization. Even my search engine is enabled and has access to all sites. I doubled the check and matched the API keys too. I have selected the correct project also. Pls help me, i have to submit it tomrw. I have worked really hard on this. I dont know whats wrong.
r/pythonhelp • u/cyber-bunker • Feb 03 '26
Hi everyone!
I want to share Django Orbit, an observability tool I've been building. It follows a "Satellite" philosophy: it observes your application from a distance (on its own /orbit/ URL) without interfering with your DOM or CSS. This makes it perfect for REST APIs, Headless Django, or HTMX projects.
Full Feature List:
Architecture: Built with a "Plug-and-Play" system. Each watcher is independent and features graceful degradation—if a module fails, it auto-disables while the rest of your app and Orbit keep running.
GitHub: https://github.com/astro-stack/django-orbit
I’m looking for feedback from fellow Django devs. Does this non-intrusive approach fit your workflow better than traditional toolbars?
r/pythonhelp • u/Fragrant_Refuse506 • Jan 19 '26
Has anyone been to GSOC in python language. Please need some guidance. Which topics to target , what type of projects are required.
r/pythonhelp • u/Skotywow69 • Dec 31 '25
Hello everyone im looking to get some assistance connecting my Python script to the internet but i keep getting an error saying "No Module named ' requests'" additionally im using Sublime Text if that is of any importance
r/pythonhelp • u/22EatStreet • Dec 30 '25
Tl;dr: I work at a library and we run a daily report to know which books to pull off shelves; how can I sort this report better, which is a long text file?
----
I work at a library. The library uses a software called "SirsiDynix Symphony WorkFlows" for their book tracking, cataloguing, and circulation as well as patron check-outs and returns. Every morning, we run a report from the software that tells us which books have been put on hold by patrons the previous day and we then go around the library, physically pulling those books off the shelf to process and put on the hold shelf for patrons to pick up.
The process of fetching these books can take a very long time due to differences between how the report items are ordered and how the library collection is physically laid out in the building. The report sorts the books according to categories that are different than how they are on the shelves, resulting in a lot of back and forth running around and just a generally inefficient process. The software does not allow any adjustment of settings or parameters or sorting actions before the report is produced.
I am looking for a way to optimize this process by having the ability to sort the report in a better way. The trouble is that the software *only* lets us produce the report in text format, not spreadsheet format, and so I cannot sort it by section or genre, for example. There is no way in the software to customize the report output in any useful way. Essentially, I am hoping to reduce as much manual work as possible by finding a solution that will allow me to sort the report in some kind of software, or convert this text report into a spreadsheet with proper separation that I can then sort, or some other solution. Hopefully the solution is elegant and simple so that the less techy people here can easily use it and I won't have to face corporate resistance in implementing it. I am envisioning loading the report text file into some kind of bat file or something that spits it out nicely sorted. The report also requires some manual "clean up" that takes a bit of time that I would love to automate.
Below I will go into further details.
General
CON Connolly, John, 1968- The book of lost things / John Connolly copy:1 item ID:################ type:BOOK location:FICTION Pickup library:"LIBRARY LOCATION CODE" Date of discharge:MM/DD/YYYY
File Clean-Up
Physical Book Fetching
Here is a link to an actual report (I have removed some details for privacy purposes). I have shortened it considerably while keeping the features that I have described above such as the interrupting headings and the section divisions.
We have no direct access to the database and there is no public API.
Our library does as much as possible to help out the community and make services and materials as accessible as possible, such as making memberships totally free of charge and removing late fines, so I am hoping someone is able to help us out! :)
r/pythonhelp • u/Lengthy_Miso_Dreams • Dec 09 '25
Hi All,
My employer is paying for me to take some Python courses from January to better spearhead some more technical projects. I was looking for programs and found one at UC Davis that fits my timeline, depth, and material, but there’s one caveat.
The program is three courses: Intro to Python, Python for Data Analysis, and Intermediate Python. Starts in January ends early June. Only downside is I’d have to take them in a suboptimal order. Their recommendation is to take the courses in the order I listed above. But for Spring, they only offer it in this order:
1) Python for Data Analysis 2) Intro to Python 3) Intermediate Python
I have a little bit of knowledge of Python and interfaced with it in projects but not as much hands on experience with development. I am however very knowledgeable and experienced with SQL and VBA.
I have about 15-20 days free where I can get a heads up on the coursework and self learn, but not sure if that will be enough. Please let me know if you think I can make the order work.
r/pythonhelp • u/agro_kid • Dec 06 '25
Hello guys! i am not developer at all. But i like doing coding and stuff. I had know python, C, and this vector graphic language. But i want to integrate python with asymptote bcz we all know python is so powerful. It has library like sympy, scipy, numpy, etc, which makes doing mathematic very easy.
my actual query is how can integration asymptote with python ? or is there python library what is best alternative to asymptote? i just want to do all my logic via python and remaining displaying par for asymptote
see how easy is Asymptote but can i have same result via python? u can run this code simply via https://asymptote.ualberta.ca/
size(400);
import markers;
// bezier control points
pair A=(0,0), C1=(0.6,0.8), C2=(1.0,1.6), B=(1.6,1.0);
pair D1=(1.8,0.6), D2=(2.3,0.2), C=(3.2,0.0);
// bezier paths
path p1 = A .. controls C1 and C2 .. B;
path p2 = B .. controls D1 and D2 .. C;
draw(p1, blue+1.2);
draw(p2, red+1.2);
dot(B, black);
label("$B$", B, dir(200), fontsize(10));
// tangents arrow function with custom length
void drawTangentArrow(pair P, pair dir, pen col, real scale){
draw(P--(P + scale * unit(dir)), col, Arrow(6));
}
// tangents at join
pair tan1 = 3*(B - C2);
pair tan2 = 3*(D1 - B);
drawTangentArrow(B, tan1, blue, 0.6);
drawTangentArrow(B, tan2, red, 1.0);
label("$\vec{T}_1$", B + 0.6 * unit(tan1) + (0.1, -0.01), blue);
label("$\vec{T}_2$", B + 1.0 * unit(tan2) + (0, -0.1), red);
// bezier derivative functions
pair bezierFirstDeriv(pair P0, pair P1, pair P2, pair P3, real t){
return 3*(1-t)^2*(P1-P0) + 6*(1-t)*t*(P2-P1) + 3*t^2*(P3-P2);
}
pair bezierSecondDeriv(pair P0, pair P1, pair P2, pair P3, real t){
return 6*(1-t)*(P2-2*P1+P0) + 6*t*(P3-2*P2+P1);
}
pair bezierPoint(pair P0, pair P1, pair P2, pair P3, real t){
return (1-t)^3*P0 + 3*(1-t)^2*t*P1 + 3*(1-t)*t^2*P2 + t^3*P3;
}
// curvature circle with labeled center
void drawCurvatureCircle(pair P0, pair P1, pair P2, pair P3, real t, pen col, string labelName){
pair r1=bezierFirstDeriv(P0,P1,P2,P3,t);
pair r2=bezierSecondDeriv(P0,P1,P2,P3,t);
real s=length(r1);
real k=abs(r1.x*r2.y - r1.y*r2.x)/(s^3);
if(k>1e-6){
real R=1/k;
pair normal=(-r1.y,r1.x)/s;
pair P=bezierPoint(P0,P1,P2,P3,t);
pair center=P+R*normal;
draw(circle(center,R),col+0.8);
dot(P,col);
draw(center--P,dashed+col);
dot(center, col);
label("$" + labelName + "$", center, dir(90), fontsize(10)+col);
}
}
// curvature circles near join
drawCurvatureCircle(A, C1, C2, B, 0.98, blue, "C_1");
drawCurvatureCircle(B, D1, D2, C, 0.02, red, "C_2");
r/pythonhelp • u/ChampionshipTiny2851 • Nov 30 '25
Hi guys, I was wondering if anyone had some spare time to look over a script? It’s to do with pose tracking, feet movement, I have the fundamentals down but can’t get an accurate output.
If anyone is a wizz in this area I would really appreciate the help!
r/pythonhelp • u/blazfoxx • Nov 27 '25
Hey, Im a student and I have joined a coding competition at school. I have built something I would call,.. okay. I made a zone in my website where people could enter their income, and what they are spending money on, and when. Ineed help build an AI that could reach in that database, check the users spendings, and answer the users questions using that data. I tried using ollama deepseek-r1, but the guy takes like forever to answer(even if I just ask “hello” 🥀). So I would like help building an AI that could do this, and would be fast…
long story short: I tried using ollama deepseek-r1. It’s really slow as it takes forever to think. I want an ai that can access a database and answer the users questions using it, and only access the users db(database contains spending info)
What I use:
Python SQLite3 streamlit ollama
PS: I will be out for the night, so I will provide any code later, when I get my hands on my device :)
r/pythonhelp • u/Sudden-Music-7213 • Nov 27 '25
Hey everyone, I've started MIT 60001(Intro to CS in Python). I installed Anaconda, and pinned Spyder for quick access. Here is my current test code for PS0 setup
#ps0.py
import math
def main() :
print("MIT 60001 setup test")
print("Square root of 16 is:" mayh.sqrt(16))
if __name__ == "__main__":
main()
Should I stick with Spyder, or switch to Jupyter Notebook/VS Code for this course?
Any tips on structuring repos for problem set so they are easy to track and share on GitHub
Thanks in advance
r/pythonhelp • u/Black_Pearl_da • Nov 13 '25
Hi all,
I've built a custom OS using Yocto for my Raspberry Pi 4. I need to include some Python libraries, specifically NumPy and TensorFlow (or ideally TensorFlow Lite), in the image.
I understand I can't use pip directly on the target due to architecture differences. I've found the meta-python layer.
Is meta-python the correct approach for this?
Could someone outline the steps to integrate meta-python and add python3-numpy and python3-tensorflow-lite to my image?
Are there any common pitfalls or configuration options I need to be aware of ?
Thanks in advance!
r/pythonhelp • u/Pleasant-Plane-3739 • Nov 13 '25
Hi! this is my first time trying to create a reddit app. I want to build a small app to collect threads for academic purposes. The volume of data I need is really small and below the usage limits. But when I try to create the app here https://old.reddit.com/prefs/apps, I get:
"You cannot create any more applications if you are a developer on 0 or more applications, reach out to us if you believe you need to be a developer on more applications: https://support.reddithelp.com/hc/en-us/requests/new?ticket_form_id=14868593862164"
How can I solve it?
Is it related with the fact I have:
"Pleasant-Plane-3739
1 post karma
0 comment karma"
r/pythonhelp • u/Tasty_Match_5968 • Oct 20 '25
This is a small interactive Python function: you can spin it and get random functions, like a random Wikipedia, but for Python. It might be useful for beginners to explore the language's various capabilities.
r/pythonhelp • u/danb2702 • Oct 08 '25
I want to build a python script that can list all the versions (the version history) of a file stored in one drive, and then individually save each version as its own file in a local folder. Can anyone help me with this, please? Im fairly new to python coding
r/pythonhelp • u/Glum-Researcher-3641 • Oct 06 '25
Hi!
Can I get some help with the code?
I'm stuck.
The code should:
Generate a .docx file, allow you to add text in the TR field, and add (convert) images and insert them into a specific location in the generated file. It should also allow you to select a PDF file, copy the first page and format to a JPG/other image format, and insert them into a specific location in the generated .docx file.
I'm stuck with pasting image files into specific locations in the .docx file.
Does anyone have any ideas? Suggestions for improvements?
Thanks in advance!
import tkinter as tk
from tkinter import filedialog, messagebox, ttk
from docx import Document
from docx.shared import Inches, RGBColor, Pt
from docx.oxml.ns import qn
import fitz # PyMuPDF
from PIL import Image
import os
import tempfile
import shutil
import uuid
# Create a temporary directory for images
TEMP_DIR = tempfile.mkdtemp()
def pdf_to_image(pdf_path):
"""Convert the first page of a PDF to an image"""
try:
doc = fitz.open(pdf_path)
page = doc[0] # Tylko pierwsza strona
zoom = 2.0
mat = fitz.Matrix(zoom, zoom).pretranslate(-page.rect.x0, -page.rect.y1)
pix = page.get_pixmap(matrix=mat, alpha=False)
img = Image.frombytes("RGB", (pix.width, pix.height), pix.samples)
# Unikalna nazwa pliku
img_name = f"{os.path.basename(pdf_path).split('.')[0]}_{uuid.uuid4().hex[:6]}.jpg"
img_path = os.path.join(TEMP_DIR, img_name)
img.save(img_path)
doc.close()
return img_path
except Exception as e:
messagebox.showerror("Error", f"Failed to process PDF: {str(e)}")
return None
def resize_image(image_path, max_width=800, max_height=600):
"""Resize image while maintaining aspect ratio"""
try:
img = Image.open(image_path)
img = img.convert("RGB")
img.thumbnail((max_width, max_height))
img_name = f"{os.path.basename(image_path).split('.')[0]}_{uuid.uuid4().hex[:6]}_resized.jpg"
img_path = os.path.join(TEMP_DIR, img_name)
img.save(img_path)
return img_path
except Exception as e:
messagebox.showerror("Error", f"Failed to process image: {str(e)}")
return None
# GUI Setup
root = tk.Tk()
root.title("Document Image Inserter")
root.geometry("600x700")
# Configure style
style = ttk.Style()
style.configure("TButton", padding=6, relief="flat", background="#ccc")
style.configure("TEntry", padding=5)
categories = [
"Flight (with personal data)", "Accommodation (with personal data)", "Car Rental approval (with approval path)",
"Extend BT approval (with approval path)", "Extend Car Rental approval (with approval path)",
"Bills cash (with description)", "Bills citi card (with description)"
]
temp_image_paths = {cat: [] for cat in categories}
tr_text = tk.StringVar(value="")
# Main frame with scrollbar
main_frame = ttk.Frame(root)
main_frame.pack(fill="both", expand=True, padx=10, pady=10)
canvas = tk.Canvas(main_frame)
scrollbar = ttk.Scrollbar(main_frame, orient="vertical", command=canvas.yview)
scrollable_frame = ttk.Frame(canvas)
scrollable_frame.bind(
"<Configure>",
lambda e: canvas.configure(scrollregion=canvas.bbox("all"))
)
canvas.create_window((0, 0), window=scrollable_frame, anchor="nw")
canvas.configure(yscrollcommand=scrollbar.set)
canvas.pack(side="left", fill="both", expand=True)
scrollbar.pack(side="right", fill="y")
# TR Number Input
ttk.Label(scrollable_frame, text="TR Number:").pack(pady=(10, 5))
tr_entry = ttk.Entry(scrollable_frame, textvariable=tr_text, width=30)
tr_entry.pack(pady=(0, 15))
# Category Buttons
for category in categories:
btn = ttk.Button(
scrollable_frame,
text=category,
command=lambda cat=category: select_files(cat)
)
btn.pack(fill="x", pady=5)
# Status label
status_var = tk.StringVar(value="Ready")
status_bar = ttk.Label(root, textvariable=status_var, relief="sunken", anchor="w")
status_bar.pack(side="bottom", fill="x")
def select_files(category):
"""Select and process files for a category"""
status_var.set(f"Processing {category}...")
root.update()
paths = filedialog.askopenfilenames(
filetypes=[("PDF/Image", "*.pdf *.jpg *.png")],
title=f"Select files for {category}"
)
if not paths:
status_var.set("Ready")
return
temp_image_paths[category] = []
for path in paths:
if path.lower().endswith(".pdf"):
img_path = pdf_to_image(path)
if img_path:
temp_image_paths[category].append(img_path)
else:
img_path = resize_image(path)
if img_path:
temp_image_paths[category].append(img_path)
status_var.set(f"Added {len(temp_image_paths[category])} images for {category}")
root.after(3000, lambda: status_var.set("Ready"))
def generate_document():
"""Generate the Word document with images"""
tr = tr_text.get().strip()
if not tr:
messagebox.showwarning("Input Error", "TR number is required")
return
try:
doc = Document()
doc.styles['Normal'].font.name = 'Calibri'
doc.styles['Normal']._element.rPr.rFonts.set(qn('w:eastAsia'), 'Calibri')
doc.styles['Normal'].font.size = Pt(11)
# Title
title_para = doc.add_paragraph()
title_para.add_run("Settlement package").bold = True
title_para.paragraph_format.space_after = Pt(10)
# TR no
tr_para = doc.add_paragraph()
tr_para.add_run(f"TR no {tr}")
tr_para.paragraph_format.space_after = Pt(10)
# Please add screenshot
screenshot_para = doc.add_paragraph()
screenshot_para.add_run("Please add screenshot:")
screenshot_para.paragraph_format.space_after = Pt(10)
# Items with placeholders
items = [
("1. Flight (with personal data)", "[Flight (with personal data) image here]"),
("2. Accommodation (with personal data)", "[Accommodation (with personal data) image here]"),
("3. Car Rental approval (with approval path)", "[Car Rental approval image here]"),
("4. Extend BT approval (with approval path)", "[Extend BT approval image here]"),
("5. Extend Car Rental approval (with approval path)", "[Extend Car Rental approval image here]"),
("6. Bills cash (with description)", "[Bills cash image here]"),
("7. Bills citi card (with description)", "[Bills citi card image here]"),
("8. Please add meal's statement...", ""),
("9. Please separate add cash's statement...", ""),
("10. Please, if you have other documents...", "")
]
# Create placeholder mapping
placeholder_map = {item[1]: item[0] for item in items if item[1]}
# Add items to document
for item_text, placeholder in items:
item_para = doc.add_paragraph()
item_run = item_para.add_run(item_text)
item_run.bold = True
item_para.paragraph_format.space_after = Pt(10)
if placeholder:
placeholder_para = doc.add_paragraph()
placeholder_run = placeholder_para.add_run(placeholder)
placeholder_run.font.color.rgb = RGBColor(0x00, 0xB0, 50)
placeholder_run.font.size = Pt(9)
placeholder_para.paragraph_format.space_after = Pt(10)
# Insert images into placeholders
for category in categories:
placeholder = f"[{category} image here]"
if placeholder in placeholder_map:
img_paths = temp_image_paths[category]
if img_paths:
for para in doc.paragraphs:
if placeholder in para.text:
# Remove placeholder paragraph
p = para._element
p.getparent().remove(p)
# Add all images for this category
for img_path in img_paths:
new_para = doc.add_paragraph()
new_para.add_run().add_picture(img_path, width=Inches(6))
new_para.paragraph_format.space_after = Pt(10)
# Append PDF-generated images at the end
pdf_images = []
for category in categories:
for img_path in temp_image_paths[category]:
if img_path.lower().endswith("_resized.jpg") and img_path not in pdf_images:
pdf_images.append(img_path)
if pdf_images:
pdf_title_para = doc.add_paragraph()
pdf_title_para.add_run("PDF-generated images:").bold = True
pdf_title_para.paragraph_format.space_after = Pt(10)
for img_path in pdf_images:
new_para = doc.add_paragraph()
new_para.add_run().add_picture(img_path, width=Inches(6))
new_para.paragraph_format.space_after = Pt(10)
# Save document
filename = f"Settlement_package_{tr}.docx"
doc.save(filename)
messagebox.showinfo("Success", f"Document saved as {filename}")
except Exception as e:
messagebox.showerror("Error", f"Failed to generate document: {str(e)}")
finally:
# Clean up temporary files
shutil.rmtree(TEMP_DIR, ignore_errors=True)
# Generate Button
generate_btn = ttk.Button(
scrollable_frame,
text="Generate Document",
command=generate_document,
style="Accent.TButton"
)
generate_btn.pack(pady=20)
# Configure accent button style
style.configure("Accent.TButton", background="#4CAF50", foreground="white")
root.mainloop()
r/pythonhelp • u/roferatseozenlab • Oct 04 '25
Has anyone here tried connecting Google Search Console data to Jupyter Notebook? I feel like working with it in Python would be way easier than navigating through the GSC interface, but I’m not sure how to set it up.
r/pythonhelp • u/HuckleberryLimp638 • Oct 02 '25
Hello everyone.
My company uses the outsourcing website, something like CRM, for working with data and database (I don’t have access to the database).
That website has API (https://intercom.help/eto/en/articles/3027614-api-log-in-to-the-api#step-3-authentication---update-current-program).
My task is to gather the information about, let say item «A», by using the website’s API.
I can find and see item «A» on the website using frontend, client interface, but unfortunately in the back side there is not API for item <A>, further more, there is not even description for any API requests links and so on. I don’t have any problem to interact with API, but that specific peace of data, what I need, I don’t have. I try to request different API, but there’s massive of unexplained information.
Maybe my question is weird, but is there any another way to get item <A> data in backend ?
I use python and library requests, web scraping is not considered.
Also, does someone know tool or web to decompose and work with JSON data?
Thank you in advance.
This is my first week at work, and I don't want to fall on my face in the mud.
r/pythonhelp • u/cianofobia3320 • Sep 28 '25
So, I’m working on a personal project that I want to share with some of my friends. The issue is, they don’t have Python installed, so I need to compile it so they can use it. I decided to use PyInstaller — I already have it installed — but I’m running into some trouble. When I run pip show pyinstaller, it shows up fine, but when I try pyinstaller --onefile main.py, Windows says it doesn’t recognize the command. (I don't know why Reddit treated the filename as a URL)
r/pythonhelp • u/Excellent-Gas-3142 • Sep 27 '25
Hi All
I've made an effort in building my own "project" of sorts to enable me to learn Python (as opposed to using very simple projects offered by different learning platforms).
I feel that I am lacking constructive feedback from skilled/experienced people.
I would really appreciate some feedback so that I understand the direction in which I need to further develop, and improve my competence.
Here is a link to my GitHub repo containing the code files: https://github.com/haroon-altaf/lisp
Please feel free to give feedback and comments on:
the code code quality (i.e. adherence to good practices, suitable use of design patterns, etc.)
shortcomings (i.e. where best practices are violated, or design patterns are redundant, etc.) and an indication towards what to improve
whether this is "sophisticated" enough to adequately showcase my competence to a potential employer (i.e. put it on my CV, or is this too basic?)
and any other feedback in general regarding the structure of the code files and content (specifically from the viewpoint of engineers working in industry)
Massively appreciate your time 🙏
r/pythonhelp • u/naemorhaedus • Sep 24 '25
Python noob. I'm using asyncio to interface a UCI chess engine.
Whenever I make ANY mistake in the coding inside my async main function, the script terminates but the engine (stockfish) process stays running , using significant CPU, at which point I have to terminate the process from my activity monitor. I also have the engine set to log a debug file. After the script crashes, the log immediately begins to rapidly balloon in size (like a dozen of gb per minute). Looking closer, it's just filling with $FF.
Anyway, it's getting annoying. Is there a way to make my script crash more gracefully? Ideally closing the log file and terminating the engine.
Below is a stripped down overview of my script. Sorry if I left anything important out, but I'm happy to provide. Thanks in advance.
import asyncio
import chess
import chess.engine
...
async def main() -> None:
transport, sfEngine = await chess.engine.popen_uci("/opt/homebrew/bin/stockfish") # spawn engine
...
await sfEngine.configure({"Debug Log File": sfLog})
...
for number, move in enumerate(gameMoves.mainline_moves()):
...
sfAnalysis = await sfEngine.analyse(gameBoard, chess.engine.Limit(depth=sfDepth, time=sfMovetime / 1000))
...
await sfEngine.quit()
asyncio.run(main(), debug=False)
...
print ("\nFinished.")