This will hide your console. Implement these lines in your code first to start hiding your console at first.
import win32gui, win32con
the_program_to_hide = win32gui.GetForegroundWindow()
win32gui.ShowWindow(the_program_to_hide , win32con.SW_HIDE)
Update May 2020 :
If you've got trouble on pip install win32con
on Command Prompt, you can simply pip install pywin32
.Then on your python script, execute import win32.lib.win32con as win32con
instead of import win32con
.
To show back your program again win32con.SW_SHOW
works fine:
win32gui.ShowWindow(the_program_to_hide , win32con.SW_SHOW)