hello.py is
setup.py is
Thanks.
#!/usr/bin/env python # -*- coding: utf-8 -*- from datetime import datetime import sys from sys import stdout stdout.write('Hello from cx_Freeze\n') stdout.write('The current date is %s\n\n' % datetime.today().strftime('%B %d, %Y %H:%M:%S')) stdout.write('Executable: %r\n' % sys.executable) stdout.write('Prefix: %r\n' % sys.prefix) stdout.write('File system encoding: %r\n\n' % sys.getfilesystemencoding()) stdout.write('ARGUMENTS:\n') for a in sys.argv: stdout.write('%s\n' % a) stdout.write('\n') stdout.write('PATH:\n') for p in sys.path: stdout.write('%s\n' % p) stdout.write('\n')The two files, hello.py and setup.py came with cx_Freeze when I downloaded it and therefore should be in proper form.
setup.py is
# -*- coding: utf-8 -*- # A very simple setup script to create a single executable # # hello.py is a very simple 'Hello, world' type script which also displays the # environment in which the script runs # # Run the build process by running the command 'python setup.py build' # # If everything works well you should find a subdirectory in the build # subdirectory that contains the files needed to run the script without Python from cx_Freeze import setup, Executable executables = [ Executable('hello.py') ] setup(name='hello', version='0.1', description='Sample cx_Freeze script', executables=executables )I have previously had no luck with py2exe or pyinstaller, which evidently work only with python 2.
Thanks.