IPython magic function%粘贴问题

用户

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

tkinter_clipboard\u get()不接受参数(给定1)

整个堆栈如下所示:

In [131]: %paste --------------------------------------------------------------------------- TypeError Traceback (most recent call 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 # Ensure we're not keeping object references around:

1987 self._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 except TryNext as 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:

有什么想法吗?在


已被浏览了4027次
更新日期: 2020-09-28 07:39:27
1 个回答
fefe Tyson

这是最近出现的一个bug fixed in the development version。在

作为一种解决方法,您可以安装pywin32,这将为它提供一种访问剪贴板的不同方法。在

评论 - 2020年8月7日 16:59

最新Python问答

推荐Python问答