Search code examples
pythonpython-3.xcx-freeze

cx_Freeze - Building exe - Windows 64bit - Invalid Syntax


Trying to build a exe file but am having an error I don't understand. I followed a tutorial so unless it had bad instructions I don't see what is wrong. cmd print screen

-Code-

import cx_Freeze

executables = [cx_Freeze.Executable('Wedgie la Apple.py')]

cx_Freeze.setup(
    name='Wedgie la Apple'
    options={'build_exe':{'packages':['pygame'],'incude_files':['apple.png','appleIcon.png','grass.png','intro.png','rock.png','snakeBody.png','snakeHead.png','intro.wav','select.wav','music1.wav','music2.wav','music3.wav','music4.wav','nom_nom_nom1.wav','nom_nom_nom2.wav','nom_nom_nom3.wav','death_3.wav','death_4.wav','death_6.wav']}},

    description = 'Wedgie la Apple - Snake Game'
    executables = executables


    )

Solution

  • You are missing a ,between keywords - like name='Wedgie la Apple',

    Example function:

    >>> def a(a="abc", b="cef"):
    ...     print(a, b)
    

    Wrong:

    >>> a(a="abcdef" b="feggsef")
      File "<stdin>", line 1
        a(a="abcdef" b="feggsef")
                     ^
    SyntaxError: invalid syntax
    

    Working:

    >>> a(a="abcdef", b="feggsef")
    abcdef feggsef