Game Development in Python 3 With PyGame - 16 - Convert to executable
Why Stack Overflow recommends it
Stack Overflow users who follow this tutorial link it in their questions when they hit cx_Freeze errors while trying to package their own games.
Recommended by 0 people across 0 different months, 2017 to 2020.
What it is
Part 16 of sentdex's PyGame with Python 3 tutorial series. He shows how to use cx_Freeze to turn a finished PyGame project into an executable or installer that can run on machines without Python or PyGame installed.
What people said
Cites Braincain007 · 2017-12 · Stack Overflow · on “I cant convert Python to exe”
I created a python script and wanted to give it to my friends. So I go to youtube and follow this [this video] video, (after trying many others). I run it and get a TLC Library error. No problem, I went and found an answer to solve this right here [LINK] on stack over flow. I input that piece of code, (changing Python35 to 36 and making sure my TLC is in the same place it says). I run it but get a different error, in my cmd prompt it says File "C:\Users\Brain\AppData\Local\Programs\Python\Python36\lib\site-packages\cx_Freeze\freezer.py", line 750, in __init__ parts = version.split(".") AttributeError: 'NoneType' object has no attribute 'split' " I just want to make my game an send to friends. Ple
Cites user12489351 · 2020-01 · Stack Overflow · on “Python is detecting syntax error that's right”
I'm watching this YouTube tutorial on how to make a video game, and now we're converting it to exe, and this is my setup code to convert the game to exe (not the game's code itself): import cx_Freeze executables = [cx_Freeze.Executable("pygame sentdex.py")] cx_Freeze.setup( name="A bit racey", options={"build_exe": {"packages":["pygame"], "include_files":["car.png"]}} #if you have other included files put them here. like fonts. executables = executables) When I try convert, this happens: PS C:\Users\Damon Tattersfield\Desktop\video game\code\python codes> python setup.py build File "setup.py", line 9 executables = executables) ^ SyntaxError: invalid syntax PS C:\Users\Damon Tattersfield\Desk
Cites AdamT · 2020-04 · Stack Overflow · on “What happened to my source code after I turned my game into an executive with cx_freeze?”
I'm very new to programming. I made a game, or at least something that kinda resembles a game, with python and pygame. I follow this video: [this video] to turn my game and its files into an executive. After I made my files into an executive, I moved the old files around, including the source code, to see if the executive could function by itself, and I think I put the source code in the recycling bin. But I restored everything in the recycling bin, so that shouldn't have mattered. My source code was titled "Game1.txt", and I did find the file after searching my computer, but it was much smaller. The old file had over 100 lines of code, and the new one has only like 5. What happened? can I fix it