Display both window AND console with pyinstaller

7,685

Just make it not window-based. That is, drop the -w (a.k.a. --windowed) option. Then your executable will start with a console attached, where all output (from the print function) will appear.

Having a console attached does not affect the GUI window that your application apparently also creates. Rather, supplying the --windowed option suppresses the extra console window that pops up when you run (double-click) the bundled .exe file on Windows. (On Linux, it makes no difference.)

Share:
7,685

Related videos on Youtube

xupaii
Author by

xupaii

Updated on September 18, 2022

Comments

  • xupaii
    xupaii over 1 year

    I'm currently using auto py to exe, which is a program to write a pyinstaller command and execute it for you. It has two options: Console-Based & Window-Based(hide the console). However, I would like to display both. What more would I need to add to make it display both a window and console?

    Current command:

    pyinstaller -y -F -w  "C:\Users\Me\Downloads\file.py"
    
  • xupaii
    xupaii almost 5 years
    Oh yeah, I wasn't waiting long enough haha! Thanks :)