1

我目前正在使用 ipython。当我尝试使用著名的魔术函数 %paste 时,我收到一条错误消息:

tkinter_clipboard_get() 不带参数(给定 1 个)

整个堆栈如下所示:

在 [131] 中:%paste ------------------------------------------- -------------------------------- TypeError Traceback (最近一次调用最后一次) ----> 1 get_ipython()。魔术(你'粘贴')

C:\Python27\lib\site-packages\IPython\core\interactiveshell.pyc in magic(self, a rg_s, next_input) 1983
self._magic_locals = sys._getframe(1).f_locals 1984
with self.builtin_trap: -> 1985 result = fn(magic_args) 1986 # 确保我们没有保留对象引用:

1987 自我._magic_locals = {}

C:\Python27\lib\site-packages\IPython\frontend\terminal\interactiveshell.pyc in magic_paste(self, parameter_s) 633 return 634 try: --> 635 text = self.shell.hooks.clipboard_get() 636 block = strip_email_quotes(text.splitlines()) 637 除了 TryNext 作为 clipboard_exc:

C:\Python27\lib\site-packages\IPython\core\hooks.pyc in call (self, args, * kw) 133 #print "prio",prio,"cmd",cmd #dbg

134             try:

--> 135 return cmd(*args, **kw) 136 except TryNext, exc: 137 if exc.args or exc.kwargs:

C:\Python27\lib\site-packages\IPython\core\hooks.pyc in clipboard_get(self) 225 for func in chain: 226 dispatcher.add(func) --> 227 text = dispatcher() 228 return text

C:\Python27\lib\site-packages\IPython\core\hooks.pyc in call (self, args, * kw) 133 #print "prio",prio,"cmd",cmd #dbg

134             try:

--> 135 return cmd(*args, **kw) 136 except TryNext, exc: 137 if exc.args or exc.kwargs:

有任何想法吗?

4

1 回答 1

1

这是最近在开发版本中修复的错误。

作为一种解决方法,您可以安装 pywin32,这应该会给它一种访问剪贴板的不同方式。

于 2012-05-17T16:29:23.627 回答