Python Forum
cx_Freeze doesn't seem to work
Thread Rating:
  • 2 Vote(s) - 2.5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
cx_Freeze doesn't seem to work
#3
hello.py is

#!/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.
Reply


Messages In This Thread
cx_Freeze doesn't seem to work - by owenwalker65 - Jan-02-2017, 05:49 PM
RE: cx_Freeze doesn't seem to work - by metulburr - Jan-02-2017, 06:03 PM
RE: cx_Freeze doesn't seem to work - by owenwalker65 - Jan-02-2017, 06:55 PM
RE: cx_Freeze doesn't seem to work - by metulburr - Jan-02-2017, 08:48 PM
RE: cx_Freeze doesn't seem to work - by snippsat - Jan-03-2017, 12:07 AM
RE: cx_Freeze doesn't seem to work - by issac_n - Dec-06-2017, 10:09 AM
RE: cx_Freeze doesn't seem to work - by snippsat - Dec-06-2017, 05:49 PM
RE: cx_Freeze doesn't seem to work - by issac_n - Dec-07-2017, 02:23 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Convolution "same" in Python doesn't work as Matlab claw91 4 3,860 Oct-01-2020, 08:59 AM
Last Post: claw91
  Numpy doesn't work in Spyder 4.1.3 player1681 1 2,188 Jun-02-2020, 11:26 AM
Last Post: jefsummers
  scipy interp2d doesn't work player1681 4 4,574 Feb-05-2020, 09:50 AM
Last Post: player1681
  cx_freeze exe does nothing taigi100 0 2,707 Jul-08-2018, 02:11 PM
Last Post: taigi100
  cx_freeze exe error issac_n 0 3,346 Dec-07-2017, 10:08 AM
Last Post: issac_n
  cx_freeze setup.py TCL_LIBRARY error issac_n 0 3,805 Dec-05-2017, 10:40 AM
Last Post: issac_n
  Matplotlib Doesn't Work Ian12290 6 13,351 Feb-28-2017, 06:18 AM
Last Post: buran

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020