[Python] How to display two windows in two different display with tkinter?

Discussão em 'Python' iniciado por Stack, Fevereiro 2, 2025.

  1. Stack

    Stack Membro Participativo

    After looking for solution for a week, I ask my question here hopping you can help me.

    I work on a python project, using tkinter on a raspberry pi 4. As the raspberry allows me to use two different monitor, i would like to be able to display one window per screen.

    My program is very basics. It created two differents windows (window = Tk() and root = tk.Toplevel(window)). I am trying to have window displays on screen 1 and root display on screen 2.

    Do you think it is possible with tkinter or an other python library ?

    thanks a lot for your kind help

    ---Edit---- The solution was found thanks to the comments given.

    I actually used tk.geomtry to solve it. For those who are interessted :


    window.geometry(f'{width}x{height}+0+0') #first window on the first screen root.geometry(f'{width}x{height}+1920+0') #second window, with +1920 on x to put it on the second screen.
    ​

    That works perfectly so thank you guys

    Continue reading...

Compartilhe esta Página