注意:部分文章发布时间较长,可能存在未知因素,购买时建议在本站搜索商家名称,先充分了解商家动态。
交流:唯一投稿邮箱:hostvps@88.com。
网友 sRGB 说:
*帖最后由 sRGB 于 2022-11-9 21:31 编辑
Python 自动补全模块 readline 解析
readline模块定义了一系列函数用来读写Python解释器中历史命令,并提供自动补全命令功能。这个模块可以通过relcompleter模块直接调用,模块中的设置会影响解释器中的交互提示,以及内置函数raw_input()和input()提供的提示。
readline模块定义了以下方法: 输入 readline. **按 TAB 就能自动补全显示
Python 3.10 和 3.11 在 Windows 11 使用 pyreadline 库会如下错误
Python 3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13) [MSC v.1929 ** bit (AMD**)] on win32
Type &*uot;****&*uot;, &*uot;copy**ght&*uot;, &*uot;credits&*uot; or &*uot;license&*uot; for **** information.
Failed calling sys.__interactivehook__
Traceback (most recent call last):
File &*uot;C:\Users\vip\AppData\Local\P**grams\Python\Python310\lib\site.py&*uot;, line 446, in register_readline
import readline
File &*uot;C:\Users\vip\AppData\Local\P**grams\Python\Python310\lib\site-packages\readline.py&*uot;, line 34, in <module>
rl = Readline()
File &*uot;C:\Users\vip\AppData\Local\P**grams\Python\Python310\lib\site-packages\pyreadline\rlmain.py&*uot;, line 422, in __init__
BaseReadline.__init__(self)
File &*uot;C:\Users\vip\AppData\Local\P**grams\Python\Python310\lib\site-packages\pyreadline\rlmain.py&*uot;, line 62, in __init__
mode.init_editing_mode(None)
File &*uot;C:\Users\vip\AppData\Local\P**grams\Python\Python310\lib\site-packages\pyreadline\modes\ema**.py&*uot;, line 633, in init_editing_mode
self._bind_key(‘*****’, self.self_******)
File &*uot;C:\Users\vip\AppData\Local\P**grams\Python\Python310\lib\site-packages\pyreadline\modes\basemode.py&*uot;, line 162, in _bind_key
if not callable(func):
File &*uot;C:\Users\vip\AppData\Local\P**grams\Python\Python310\lib\site-packages\pyreadline\py3k_compat.py&*uot;, line 8, in callable
ret**n isinstance(x, collections.Callable)
Att**buteEr**r: module ‘collections’ has no att**bute ‘Callable’
网友 asd1314s 说:
这里都是到处求一键脚*的懒人,用不到你这高大上,刚需的会自己想办法
贝壳主机网

