Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import tkinter as tk
- from tkinter import ttk
- # import paperclip
- count = 0
- def Click():
- name = button1_Name
- global count
- count = count + 1
- print(count)
- getdata = window.clipboard_get()
- print(getdata)
- if count == 1 and getdata != name:
- button1.clipboard_append(name)
- else:
- return
- # button1.update()
- window = tk.Tk()
- window.geometry('300x300')
- window.attributes('-topmost', True)
- #naming
- Prefix = ['ST', 'WS', 'PRP']
- Middle = ['Pod', 'Pouffe', 'Sofa']
- button1_Name = Prefix[0] + '_' + Middle[0]
- button1 = ttk.Button(window, text= button1_Name , command=Click)
- button1.pack()
- window.mainloop()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement