I am trying to create a simple console programm in python which shall accept arguments. For the testing purpose I have created a simple python programm using python v2.7 on Windows 7 OS, that just prints the argument passed by the user.
Code:
#!/usr/bin/env
import sys
print ' +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n'
print ' | |\n'
print ' + Testing v1.0 +\n'
print ' + Copyright (C) 2014 +\n'
print ' | |\n'
print ' +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+\n\n'
print sys.argv
After this is created an executable using py2exe. The executable is created successfully!
Setup.py used for creating the executable using py2exe:
#!/usr/bin/python
'''
This script is used to create an executable from wxPython code
'''
from distutils.core import setup
import py2exe
setup (
name='test',
description="Testing 4 fun",
version="0.1",
windows=[{'script': 'test.py'}],#
platforms=["any"],
options={ 'py2exe': {
"compressed": 2,
"optimize": 2,
"bundle_files": 3,
}
},
)
But when I execute my executable it doesn't displays the cmd console window at all. I would like the console window to appear. How can I make it possible?
Well one solution would be to create a GUI with wxPython and then create an executable. Is there any alternative that doesn't requires any GUI programming?