How to run programs written in Python in windows by hiding terminal feedback

Asked

Viewed 25,438 times

7

I have the following situation: I have a program written in python that works with Gtk + Webkit + flask. To run such program I must enter from CMD and type "python.py file" and it starts my GUI application normally. Where as usage some debug messages are companies at the CMD terminal.

My question is this::

How to start my python application and "hide possible return from CMD error"?

Something like running the terminal in the background.

3 answers

7

Python in Windows has two executables. O python.exe and the pythonw.exe. The difference between them is that the pythonw.exe does not open a terminal window.

If to run the program by clicking on it, you can do with the Abrir com or renaming the file to .pyw.

For cmd, use pythonw arquivo.py.

0

Have you tried renaming your file .py for .pyw? This causes the program to run in the background with no return from the terminal.

-1

No need to rename the file. Enter the file path, write: python and file name and click Enter.

$ C:\Users\wagne\OneDrive\Documentos\Python> python .\aula001.py
Olá mundo!
  • But you need to do it from the terminal, getting, in this way, the return with the messages, which is exactly what is not desired by the question. Could explain better how your answer solves the problem described?

Browser other questions tagged

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