As previously explained by @Avaris in Print not working when compiled with py2exe - windows
option in setup section is intended to build GUI executables, which do not handle printing to console. The proper option is to use console
section.
So, instead of
setup(
options = {'py2exe':{'bundle_files':1, 'compressed':True,'includes':["socket","decimal","uuid"]}},
windows = [{'script':"C:\Path\To\my_script.py"}],
zipfile = None,
)
use
setup(
options = {'py2exe':{'bundle_files':1, 'compressed':True,'includes':["socket","decimal","uuid"]}},
console = [{'script': "C:\Path\To\my_script.py"}],
zipfile = None,
)
I can't say for cx_freeze, but pyinstaller also has separate routines for compiling into gui and console executables.