Python Forum
[cx_Freeze] CMD Prompt can't find my setup.py, help needed !
Thread Rating:
  • 1 Vote(s) - 1 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[cx_Freeze] CMD Prompt can't find my setup.py, help needed !
#2
>>> s = 'C:\U'
Traceback (most recent call last):
  File "<interactive input>", line 1
SyntaxError: (unicode error) 'unicodeescape' codec can't decode bytes in position 2-3: truncated \UXXXXXXXX escape
Never use single \ that way in path for Windows,
because of escape character.
Okay:
>>> s = 'C:/U'
>>> s
'C:/U'
>>> s = r'C:\U'
>>> s
'C:\\U'
>>> s = 'C:\\U'
>>> s
'C:\\U' 
Example setup script Cx_Freeze.
#cx_run.py
from cx_Freeze import setup,Executable
import sys
 
# Replaces commandline arg 'build'
#sys.argv.append("build")
 
# If need to include/exclude module/packages
includes = []
excludes = []
packages = []
 
# Console or Win32GUI
base = None
if sys.platform == "win32":
    #base = 'Console'
    base = 'Win32GUI'
 
# Name of file to make ".exe" of
filename = "Test1.py"
setup(
    name = 'Myapp',
    version = '0.1',
    description = 'Cx test',
    options = {'build_exe': {'excludes':excludes,'packages':packages,'includes':includes}},
    executables = [Executable(filename, base=base, icon=None)])
 
#--|  From command line
#python cx_run.py build
There can bye problem with cx_Freeze and Pygame.


Use Pyinstaller, pip install pyinstaller
Test with your code(Python 3.6.2),i use pipenv for virtual environment in this test.
From command line:
pyinstaller --noconsole --onefile Test1.py
In dist folder there will be 1 file Test1.exe.

Edit:
I did a test with cx_Freeze and it did work with your pygame code
Reply


Messages In This Thread
RE: [cx_Freeze] CMD Prompt can't find my setup.py, help needed ! - by snippsat - Sep-30-2017, 10:10 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [cx_Freeze] Build .exe they get more .py files, help needed ! JamieVanCadsand 3 6,942 Oct-02-2017, 10:19 AM
Last Post: snippsat

Forum Jump:

User Panel Messages

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