Show More
@@ -1,29 +1,40 b'' | |||
|
1 | 1 | import IPython.ipapi |
|
2 | import win32clipboard | |
|
3 | 2 | |
|
4 | 3 | ip = IPython.ipapi.get() |
|
5 | 4 | |
|
6 | 5 | def clip_f(self,parameter_s = ''): |
|
7 | 6 |
|
|
8 | 7 | |
|
9 | 8 |
|
|
10 | 9 |
|
|
11 | 10 | |
|
12 | 11 |
|
|
13 | 12 |
|
|
14 |
|
|
|
13 | clipboard. | |
|
15 | 14 | |
|
15 | When used without arguments, this returns the text contents of the clipboard. | |
|
16 | E.g. | |
|
17 | ||
|
18 | mytext = %clip | |
|
19 | ||
|
20 | """ | |
|
21 | ||
|
22 | import win32clipboard as cl | |
|
23 | import win32con | |
|
16 | 24 |
|
|
25 | cl.OpenClipboard() | |
|
17 | 26 |
|
|
18 | return None # xxx todo return clipboard text | |
|
27 | data = cl.GetClipboardData( win32con.CF_TEXT ) | |
|
28 | cl.CloseClipboard() | |
|
29 | return data | |
|
19 | 30 | |
|
20 | 31 |
|
|
21 | 32 |
|
|
22 | win32clipboard.OpenClipboard() | |
|
23 |
|
|
|
24 |
|
|
|
25 |
|
|
|
33 | ||
|
34 | cl.EmptyClipboard() | |
|
35 | cl.SetClipboardText( cmds ) | |
|
36 | cl.CloseClipboard() | |
|
26 | 37 |
|
|
27 | 38 |
|
|
28 | 39 | |
|
29 | 40 | ip.expose_magic("clip",clip_f) |
General Comments 0
You need to be logged in to leave comments.
Login now