SHARE
TWEET

Python - turtle - clipboard

furas Jul 6th, 2018 (edited) 83 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import turtle
  2.  
  3. canvas = turtle.getcanvas()
  4. root = canvas.winfo_toplevel()
  5.  
  6. root.clipboard_clear()
  7.  
  8. try:
  9.     print('clipboard:', root.clipboard_get())
  10. except Exception as ex:
  11.     print('clipboard is empty or object is not string')
  12.     print('ERROR:', ex)
  13.  
  14. root.clipboard_clear()
  15. root.clipboard_append("Hello ")
  16. root.clipboard_append("World")
  17.  
  18. try:
  19.     print('clipboard:', root.clipboard_get())
  20. except Exception as ex:
  21.     print('ERROR:', ex)
  22.     print('clipboard is empty or object is not string')
  23.     print('ERROR:', ex)
  24.  
  25. turtle.done()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top