Skip to content

Commit 11e1515

Browse files
committed
clipboard in tkinter and turtle
1 parent 8576586 commit 11e1515

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

tkinter/clipboard/README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ root.clipboard_clear()
88
root.clipboard_append("Hello ")
99
root.clipboard_append("World")
1010
print('clipboard:', root.clipboard_get())
11-
# Hello World
11+
# clipboard: Hello World
1212
```
1313

1414
`Clipboard` can rise exception so you can use
@@ -28,6 +28,10 @@ except Exception as ex:
2828
root.clipboard_clear()
2929
root.clipboard_append("Hello")
3030
root.clipboard_append("World", type="IMAGE")
31+
3132
print('clipboard:', root.clipboard_get(type="IMAGE"))
32-
# World # it skiped "Hello"
33+
# clipboard: World # it skiped "Hello"
34+
35+
print('clipboard:', root.clipboard_get())
36+
# clipboard: Hello # it skiped "World"
3337
```

turtle/clipboard/README.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,3 +29,16 @@ except Exception as ex:
2929
print('ERROR:', ex)
3030
```
3131

32+
`Clipboard` can use `type=` to set data type and then you can't get them using differnt `type`. As default it use `"STRING"` type
33+
34+
```python
35+
root.clipboard_clear()
36+
root.clipboard_append("Hello")
37+
root.clipboard_append("World", type="IMAGE")
38+
39+
print('clipboard:', root.clipboard_get(type="IMAGE"))
40+
# clipboard: World # it skiped "Hello"
41+
42+
print('clipboard:', root.clipboard_get())
43+
# clipboard: Hello # it skiped "World"
44+
```

0 commit comments

Comments
 (0)