In macOS, windows created by Tkinter do not automatically get focus. This is annoying when using PyCharm. If you do not take any actions, the created window will be hidden behind PyCharm. An alternative is to set the window to the top and then cancel it (code show as below). This will make the window visible after creation.
Continue reading