How can I ensure that the application windows is always on top?

后端 未结 3 877
旧巷少年郎
旧巷少年郎 2020-12-09 14:09

I have a simple Python script that runs in a console windows.

How can I ensure that the console window is always on top and if possible resize it?

3条回答
  •  盖世英雄少女心
    2020-12-09 14:31

    If you are creating your own window, you can use Tkinter to create an "always on top" window like so:

    from Tkinter import *
    root = Tk()
    root.wm_attributes("-topmost", 1)
    root.mainloop()
    

    And then put whatever you want to have happen within the main loop.

    If you are talking about the command prompt window, then you will have to use some Windows-specific utilities to keep that window on top. You can try this script for Autohotkey.

提交回复
热议问题