How to change pygame to .exe using pyinstaller module with custom icon ?

How to convert pygame file to .exe using pyinstaller module with custom icon ?

Hii, here I am going to post the answer of the above question. For better understanding and explanation I'm gonna give some visual pics.

Step 1: First off all create your .py pygame project and keep it in a folder.

Step 2: Now open cmd and enter to your respective folder in respective drive as I did...


Step 3: You will see a lot of written stuff, don't worry its all process.


Step 4: After completing the cmd task, close it.

Step 5: Move on to your folder and there you will see two folders namely "dist" and "build" and one file namely "sample.spec". Instead of sample it would be your .py file's name.

Step 6: Now put your custom icon in that folder. After doing that open sample.spec file as Notepad or Python IDLE. 

Step 7: Now change the code where I have selected. Give your icon name and save the file.


Step 8: Now open cmd and type as I do...


Step 9: After the progress close cmd. And go to your folder.

Step 10: Here you see the icon of the file changed as you defined. And also your .py file changed to .exe.



     Hence, you changed your pygame file easily using pyinstaller with your own custom icon.

Comments

Popular Posts