Below is my code when i complie it using pyinstaller --noconfirm --onedir --console "start.py"
it works perfectly but when i complile using windowed it throws me error
error is None type object has no attribute write
in messagebox
what changes i should do
maybe the problem is it doesnot have a console it throws a error while writing to console
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "myapp.settings")
django.setup()
# Function to run the Django server
def run_server():
try:
uvicorn.run("myapp.asgi:application",port=8090,host="0.0.0.0")
except Exception as e:
messagebox.showerror("Error", f"Error occurred while running server {e}")
# Function to start the server in a separate thread
def start_server():
threading.Thread(target=run_server, daemon=True).start()
# Start the server
start_server()
tried using –console it works perfectly but i dont need console