dropdown menu

Back To Home

Sunday, December 8, 2019

Python tkinter- Screen1 appear on top or bottom screen 2

Python code:

Page1.py:

import tkinter as tk
import os

root = tk.Tk()
root.attributes('-type', 'dock')
root.title('top')
#root.attributes('-type', 'splash')
root.geometry('200x200+100+100')

def open():
  os.system('python3 top2')
  
a=tk.Button(root,text="open screen 2",command=open)
a.pack()

root.mainloop()

Page2.py:

import tkinter as tk

root = tk.Tk()

root.title('top2')

root.geometry('200x200+150+150')
root.mainloop()


Screen 2 appear on top screen 1(dock):




Screen 2 appear on bottom screen 1(splash):

Video:


No comments:

Post a Comment