- # bare minimum get text from clip board
- from tkinter import *
- def myClick():
- cliboardContents = root.clipboard_get()
- cliptext = str(cliboardContents)+"\n"
- print("cliptext",cliptext)
- theTextArea.insert("end-1c",cliptext)
- root = Tk()
- myButton = Button(root, text="Get Clipboard", command=myClick)
- theTextArea = Text(root, height = 5, width = 52)
- myButton.pack()
- theTextArea.pack()
- root.mainloop()
Python Tkinter Clipboard
Posted by Anonymous on Fri 10th Mar 2023 02:22
raw | new post
Submit a correction or amendment below (click here to make a fresh posting)
After submitting an amendment, you'll be able to view the differences between the old and new posts easily.