Closed dbsantos1981 closed 4 years ago
hi
Have you seen this error in any situation?
Clearly ... but it's not tied to guy But in many cases ... it's just because you use a "lib" (or some code) which need to have a stdout output. (something which do some print statement) ... So, when freezed : it can only works in "a console". So you cant produce a freezed exe with "noconsole" mode ...
Ah yes, there's a workaround to this which I've used.
def hideConsole():
whnd = ctypes.windll.kernel32.GetConsoleWindow()
if whnd != 0:
ctypes.windll.user32.ShowWindow(whnd, 0)
You can then call hideConsole() and the console gets hidden. Also, do import ctypes.
I tested this solution in two possibilities and both worked:
I put the function call at the beginning of the code as below:
if __name__ == "__main__":
# hide the console
SapTec.hide_console(SapTec)
I put the function call in the HTML file after loading all its content.
<script>
self.hide_console();
</script>
Ah yes, there's a workaround to this which I've used.
def hideConsole(): whnd = ctypes.windll.kernel32.GetConsoleWindow() if whnd != 0: ctypes.windll.user32.ShowWindow(whnd, 0)
You can then call hideConsole() and the console gets hidden. Also, do import ctypes.
Thank you! It Works!
Greetings,
If I generate the app's executable on windows with pyinstaller using the --noconsole option, the message 'Failed to execute script App' appears when running the generated exe application, and the app does not work.
If I generate the executable without this option, the system works normally, however, the console window appears.
I would like, as in previous versions, that compilation without the console would work. Have you seen this error in any situation? Do you have any tips to give me?