Improve handling of console window in windowed apps

Suppresses console window flicker for PyInstaller windowed applications by redirecting stdout and stderr in main.py. Updates logging setup to avoid console output in windowed mode and adds fallback error logging. Suppresses pkg_resources deprecation warnings to further reduce unwanted console output.
This commit is contained in:
Your Name
2025-08-27 22:17:13 +03:00
parent 4779ab269f
commit a6a175b3d7
3 changed files with 35 additions and 19 deletions
+10
View File
@@ -1,4 +1,14 @@
import sys
import os
# Suppress console window for windowed applications (PyInstaller --windowed)
if getattr(sys, 'frozen', False):
# Running as compiled executable
if sys.stdout is None or sys.stderr is None:
# Windowed mode - redirect stdout/stderr to prevent console window flicker
import io
sys.stdout = io.StringIO()
sys.stderr = io.StringIO()
from PySide6.QtWidgets import QApplication, QMessageBox