简体   繁体   中英

Syntax Error in cx_Freeze

I wrote a program in python and while converting to exe file I am getting a Syntax Error.

My Code:

import cx_Freeze

executables = [cx_Freeze.Executable('Cake Rush.py')]

cx_Freeze.setup(
    name='Cake Rush',
    options={'build_exe':{"packages":['pygame'], 'include_files':['cake.bmp','doctor.bmp','door.bmp','pill.bmp','player.bmp','wall.bmp','web.bmp']}},
    description = 'Cake Rush Game',
    executables = executables
    )

Error:

options={"build_exe":{"packages":["pygame"],"include_files":["cake.bmp", "doctor.bmp", "door.bmp", "pill.bmp", "player.bmp", "wall.bmp", "web.bmp"]}},

SyntaxError: invalid syntax

Actually you are missing a closing curly bracket after packages .

Try the following line:

options={"build_exe":{"packages":["pygame"]},"include_files":{["cake.bmp", "doctor.bmp", "door.bmp", "pill.bmp", "player.bmp", "wall.bmp", "web.bmp"]}},

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM