首页 文章

IPython魔术功能%粘贴问题

提问于
浏览
1

我目前正在使用ipython . 当我尝试使用众所周知的魔术函数%paste时,我收到一条错误消息:

tkinter_clipboard_get() takes no arguments (1 given)

整个堆栈看起来像这样:

在[131]中:%paste ------------------------------------------ --------------------------------- TypeError Traceback(最近一次调用last)----> 1 get_ipython() .magic(u'paste')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 self._magic_locals = {} C:\ Python27 \ lib \ site-packages \ IPython \ frontend \ terminal \ magic_paste(self,parameter_s)633中的interactiveshell.pyc返回634尝试: - > 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尝试:

  • 135返回cmd(* args,** kw)136除了TryNext,exc:137如果是exc.args或者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返回文本C:\ Python27 \ lib \ site-packages \ IPython \ core \ hooks.pyc in call(self ,args,* kw)133 #print“prio”,prio,“cmd”,cmd #dbg 134尝试:

  • 135返回cmd(* args,** kw)136除了TryNext,exc:137如果是exc.args或exc.kwargs:

有任何想法吗?

1 回答

  • 1

    这是最近fixed in the development version的错误 .

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

相关问题