Avatar of Hiro 714
Hiro 714

asked on 

Python tkinter question

I would like to send a text to clipboard. Please advise

import tkinter as tk
from tkinter import ttk
from tkinter.messagebox import showinfo # root window root = tk.Tk() root.geometry('300x220') root.resizable(False, False) root.title('High Sev Template') def show_selected_size():     showinfo(         title='Result',         message=selected_size.get()     ) selected_size = tk.StringVar() sizes = (('Template1', '1'),          ('Template2', '2'),          ('Template3', '3'),          ('Template4', '4'),          ('Template5', '5')) # label label = ttk.Label(text="High Sev Template") label.pack(fill='x', padx=5, pady=5) # radio buttons for size in sizes:     r = ttk.Radiobutton(         root,         text=size[0],         value=size[1],         variable=selected_size     )     r.pack(fill='x', padx=5, pady=5) # button button = ttk.Button(     root,     text="Send to Clipboard",     command=show_selected_size) button.pack(fill='x', padx=5, pady=5) root.mainloop()

Open in new window

PythonRStatistical Packages

Avatar of undefined
Last Comment

8/22/2022 - Mon