The window is on the back when running from Pycharm

No window appears when I attempt to display one using OpenCV’s imshow() function in Python.

When running from a Terminal app, there is no problem. However, it still does not appear when executed from the terminal tab within Pycharm.

This script terminates after a set period, leaving no opportunity to view the window.

I scoured the internet but found no one experiencing the same issue. Though some posts seemed similar, they ultimately differed. I thought, “What is this?” but I solved it.

目次

Just displayed on the back

I was using macOS, and due to the design of its Python version, windows appeared behind the frontmost window. This issue does not occur on Windows.

It seems like something could be done to change it.

It was not a big problem once I realized what was happening, but it was hard to notice.

If you’re developing on a laptop, chances are you’re displaying windows in full screen.

I resolved the issue by adjusting the IDE window’s size and position to occupy the right half of the screen.

You can also click on the Python app icon

If you are developing on a laptop machine, or if shrinking the window size is inefficient, etc., the Python icon will appear in the Dock, and clicking on it will move the window to the frontmost. Of course, you will have to click on it each time you run the program, but the window will be moved to the frontmost.

Reproduce outside of Pycharm

However, this issue does not indicate any deficiencies in Pycharm. On the contrary, I reproduced it when I ran it from the terminal. The Terminal window’s position did not overlap with that of the Python window.

著書紹介

よかったらシェアしてね!
  • URLをコピーしました!
  • URLをコピーしました!

この記事を書いた人

Akira Hayashi (林 晃)のアバター Akira Hayashi (林 晃) Representative(代表), Software Engineer(ソフトウェアエンジニア)

アールケー開発代表。Appleプラットフォーム向けの開発を専門としているソフトウェアエンジニア。ソフトウェアの受託開発、技術書執筆、技術指導・セミナー講師。note, Medium, LinkedIn
-
Representative of RK Kaihatsu. Software Engineer Specializing in Development for the Apple Platform. Specializing in contract software development, technical writing, and serving as a tech workshop lecturer. note, Medium, LinkedIn

目次