Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
419 views
in Technique[技术] by (71.8m points)

If I have four monitors how can I use python to move an application to each separate monitor

I am trying to create a GUI using tkinter where you can select applications and then select what screen/monitor you want to open them on.

I was originally going to use windows layout manager using os.system to open the application, waiting for the application to open, and then opening the command prompt and running the layout for that specific application using os system('cmd /c "WinLayoutManager.exe {layout name}"').

It looked like this:

mission_planner_clicked = tkinter.IntVar()
mission_planner_check = ttk.Checkbutton(window, text="Mission Planner", variable=mission_planner_clicked)
mission_planner_check.grid(row=6, column=0, sticky=W)


def click():
    if mission_planner_clicked.get():
        os.system(r"C:Users
edDesktopMissionPlanner.exe")
        time.sleep(10)
        os.system('cmd /c "WinLayoutManager.exe MissionPlanner"')


start_up = ttk.Button(window, text="Click to start", command=click).grid(row=10, column=0)

Then I realized that was inefficient.

Now I am trying to figure out a way to select an application and then select what screen you want it on like so:

Image of my GUI

The only problem I'm having is I don't know how to move an application to a certain screen/monitor using python commands. Is there a certain plugin/module and certain commands I should use to map each monitor to a screen. This way I can click Mission Planner, Screen 1, and Click to Start to send the application Mission Planner to Monitor/Screen 1.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...