Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from tkinter import *
- import win32gui
- import time
- root = Tk()
- root['bg'] = '#fafafa'
- root.title('Название программы')
- root.wm_attributes('-alpha', 0.85)
- root.geometry('300x250')
- #текстовое поле
- ent = Entry(width=20)
- but = Button(text="Преобразовать")
- #lab = Label(width=20, bg='grey', fg='white', )
- labName = Label(width=20, bg='grey', fg='white', )
- ent.pack()
- but.pack()
- labName.pack()
- def windowsName(event):
- tempWindowName = win32gui.GetWindowText(win32gui.GetForegroundWindow())
- labName['text'] = tempWindowName
- root.title(tempWindowName)
- but.bind('<Button-1>', windowsName)
- root.bind('<Return>', windowsName)
- root.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement