Remove cmd/dos window when calling Python App

Asked

Viewed 335 times

3

I made a script in Python that has an interface, but when I run it, the Python interpreter window appears together. How to remove this CMD window that opens together with the application?

Follow the picture... TELA PRETA QUE ACOMPANHA A APLICAÇÃO PYTHON

2 answers

6


Use the pythonw.exe to run the application instead of python.exe; To do this, rename your app.py to the extent app.pyw because this extension is already associated with pythonw.exe.

-2

Enter the following script at the start of your code:

import ctypes
ctypes.windll.kernel32.FreeConsole()

Browser other questions tagged

You are not signed in. Login or sign up in order to post.