Psylent
Psylent

Reputation: 61

Python packed EXE blanks screen for a second on windows how to stop this?

I have created an EXE from a python GUI program I have put together, this all works fine as far as function goes, but whenever someone runs it their screen goes black for a second then comes back to windows and runs the program.

Is this a common problem? or could it be something specific to the code (it's very simple, just a weight calculator for rectangular plate). Code is as follows (I used cxfreeze to pack it). Note I am not really a python programmer just seemed to be the easiest way to do this with GUI (I used easyGUI to create it):

import easygui as eg
msg = "Enter Plate Information eg 9600 2400 6"
title = "Plate dimensions"
fieldNames = ["Width", "Length", "thickness"]
fieldValues = []
fieldValues = eg.multenterbox(msg, title, fieldNames)
width = float(fieldValues[0])
length= float(fieldValues[1])
thick= float(fieldValues[2])

(Some error checking I left out because it's just an if-else statement)

fieldValues = eg.multenterbox(errmsg, title, fieldNames, fieldValues)
total = (width * length * thick * 7.85)
eg.msgbox(total / 1000000, "Kilograms")

It happens with code I've put together and code I've downloaded for other things as well. Anything that's been put through cxfreeze.

It's only the blanking of the screen that I see as a problem, I can refine the code once I actually learn Python.

Upvotes: 4

Views: 278

Answers (2)

Jorge Cribb
Jorge Cribb

Reputation: 1

cxfreeze program.py --base-name=Win32GUI

Note: Using the --base-name=Win32GUI option, the console window will not appear.

Upvotes: 0

Psylent
Psylent

Reputation: 61

Just in case others encounter this and are looking for the answer not sure how "appropriate it is to answer my own question but anyway : The reason this happens is because somewhere along the line the command prompt window has been set to "fullscreen" as default, open a Command prompt window, left click on the far left top corner to get the dropdown box and select "defaults" then make sure "windowed" is selected and apply that to all future windows.

This stops the black flicker / blanking of the screen because the python shell if I can call it that executes in a DOS window before running the EXE created with cxfreeze.

Upvotes: 2

Related Questions