Advertisement
here2share

# Tk_windows_clipboard.py

Oct 18th, 2015
254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.41 KB | None | 0 0
  1. # Tk_windows_clipboard.py
  2.  
  3. import os
  4. from Tkinter import Tk
  5. root = Tk()
  6.  
  7. filename = os.path.join(os.path.expanduser('~'),'tempclipboard.txt')
  8. print filename
  9.  
  10. def getClipboardData():
  11.     try:
  12.         data = root.clipboard_get()
  13.         return data
  14.     except:
  15.         return ''
  16.  
  17. def setClipboardData(data):
  18.     root.clipboard_append(data)
  19. 0
  20. print getClipboardData()
  21. setClipboardData('Thank You, Python!')
  22. print getClipboardData()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement