this is my very simple code, printing argvs:
import sys
argv=sys.argv
for each in sys.argv:
print each
here's the output when ran:
e:\python>python test1.py 1 2 3 4 5
test1.py
1
2
3
4
5
I want it to be compiled, so I made one with py2exe:
e:\python>python setup.py py2exe
and my setup.py:
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 3}},
windows = [{'script': "test1.py"}],
zipfile = None,
)
and I don't get any output when I run my program by test1.exe 1 2 3 4 5 or with any other argvs. sys.argvs should be a list with at least one object(test1.exe) in it, therefore I think I have misunderstandings with print function of python. Is there anything I'm doing wrong here? I just want everything to be printed to commandline. I program from linux, but windows users should be using my program.
thank you very much
# ...
windows = [{'script': "test1.py"}],
#...
windows
option is used to create GUI executables, which suppresses console output. Use console
instead:
from distutils.core import setup
import py2exe, sys, os
sys.argv.append('py2exe')
setup(
options = {'py2exe': {'bundle_files': 3}},
console = [{'script': "test1.py"}],
zipfile = None,
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With