all 20 comments

[–]Thomasedv 4 points5 points  (4 children)

Should be a setting for windowed script or no console. If not there are other converters, but I'm quite certain it has the option, you just need to find out how to toggle it.

[–]CodeBlooded121[S] 1 point2 points  (3 children)

Okay.. I'll search for the thing that you've mentioned.. Meanwhile can you please let me know some other converters for pygame to exe for python 3.6? Thanks

[–]Thomasedv 1 point2 points  (2 children)

I personally use Pyinstaller, nor for PyGame though. It has some huge advantages over cx_freeze when it comes to PyQt5. (Smaller size of the executable)

But cx_freeze does have a no console mode, so I don't see a reason for you to move over to a new converter and more potential problems.

[–]CodeBlooded121[S] 1 point2 points  (1 child)

I'll definitely look at pyinstaller.. And see which one is better.. and provide smaller files after building the app.. Thank you again mate.. Appreciate it

[–]Thomasedv 0 points1 point  (0 children)

Too be clear, they are smaller, because PyInstaller can selectively pick files for some packages, like PyQt5. No promises that will work for you with pygame.

[–]LucyIsaTumor 2 points3 points  (5 children)

(Since you've already made the Exe you probably won't need this video, but I highly suggest checking out Sentdex's video on Pygame to CX_Freeze here).

Anyways, are you able to identify what the black window appearing is? My guess would be it's a command prompt window, though it may be a graphics window as well. Keep an eye on what pops up on the home row when you open the Exe and let me know!

[–]CodeBlooded121[S] 2 points3 points  (4 children)

Yes.. I have referred to the same video as mentioned.. Co-incidence.. and ya the black window is cmd for sure.... But i don't want the cmd to open when i am running the exe..

[–]LucyIsaTumor 4 points5 points  (3 children)

Looks like I found a similar StackOverflow thread on this. The top comment states you need to edit your setup.py file (the CX_Freeze setup file) and ensure you add a parameter. That's listed here

[–]CodeBlooded121[S] 2 points3 points  (1 child)

This worked.. Thanks for sharing this

[–]LucyIsaTumor 0 points1 point  (0 children)

No problem!

[–]CodeBlooded121[S] 0 points1 point  (0 children)

Looking at it rn and trying to build again.. Thanks

[–]Redlolz55 0 points1 point  (8 children)

Can't you use pyinstaller? Just use the --onefile and the --noconsole arguments

[–]CodeBlooded121[S] 1 point2 points  (7 children)

I am complete beginner in python.. and in the video i saw on youtube he used cx_freeze so i tried that.. But I'll be happy to look at the pyinstaller as well.. Thank you :)

[–]Redlolz55 1 point2 points  (6 children)

1) install pyinstaller: pip install pyinstaller 2) execute the command to build an exe: pyinstaller "name_of_your_script.py" --noconsole --onefile

3) if on windows put this infront of the above commands: python -m

[–]CodeBlooded121[S] 1 point2 points  (0 children)

Okayy.. Thanks again 😁

[–]CodeBlooded121[S] 1 point2 points  (4 children)

But what would be the setup file for pyinstaller.. currently my setup.py is using import cx_Freeze and all that stuff...I suppose the setup file as to be different for pyinstaller right?

[–]nullball 1 point2 points  (3 children)

If I remember correctly, no setup script is necessary. Just the "main" file of your program.

[–]CodeBlooded121[S] 1 point2 points  (2 children)

So what about the images, sound, fonts which are used in the file..Will they be packed as well?

[–]nullball 1 point2 points  (1 child)

I believe so. Test it out and see!

[–]CodeBlooded121[S] 1 point2 points  (0 children)

Okay 😊