How to run Python”.exe” not Spawned, as it is by >python “”

After creating the “.exe” from “” by the command line:

pyinstaller –onefile -w

i see that windows 10 spawn the process, it does not wait for the execution as it usually do if i execute as original script by the command line:


So, how to run the “.exe” as it runed by python ???? Not spawing it.

Also no “print()” prints anything what i guess that it is because the main output port has been changed by the spawning stuff…

import sys

def main():
    print('Hello World!') 



You specifically asked for this behavior through -w (--windowed):

Windows and Mac OS X: do not provide a console window for standard i/o.

Don’t use -w if you want a CLI program (and you are using the console). Use -w if you want a GUI program (and you are showing your own dialog windows and such).