'Creating an EXE from python results in command prompt opening

This is my first attempt with PyQT5 and pyinstaller. I am using a simple command to launch httpd.exe from a button click

The command I use is

os.system(cur_dir+"//htdocs//api//taskkill /f /im httpd.exe") 

It starts apache web server minimized and works fine. Apache starts and there is no command prompt window opening. When I create the exe via pyinstaller, I get a command prompt window flash when I click on this button. Is there a way to prevent that command prompt window from opening? I am using pyinstaller --onefile --windowed



Solution 1:[1]

Use the --noconsole option to get rid of command prompt window.

pyinstaller --onefile --windowed --noconsole

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1