You can accesss the clipboard simply by using the Tkinter GUI toolkit that comes with your Python installation.
Access the clipboard via Tkinter
Gribouillis
commented:
interesting
+14
''' tk_clipboard_action.py
use Tkinter to get access to the clipboard/pasteboard
tested with Python27/33
'''
try:
# Python2
import Tkinter as tk
except ImportError:
# Python3
import tkinter as tk
root = tk.Tk()
# keep the window from showing
root.withdraw()
text = "Donnerwetter"
root.clipboard_clear()
# text to clipboard
root.clipboard_append(text)
# text from clipboard
clip_text = root.clipboard_get()
print(clip_text) # --> Donnerwetter
Gribouillis
1,391
Programming Explorer
Team Colleague
sneekula
969
Nearly a Posting Maven
Gribouillis
1,391
Programming Explorer
Team Colleague
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
woooee
814
Nearly a Posting Maven
Gribouillis
1,391
Programming Explorer
Team Colleague
woooee
814
Nearly a Posting Maven
sneekula
969
Nearly a Posting Maven
TrustyTony
888
pyMod
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.