• 欢迎访问搞代码网站,推荐使用最新版火狐浏览器和Chrome浏览器访问本网站!
  • 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏搞代码吧

怎么使jupyter可以自动补全

相关文章 搞java代码 3年前 (2022-05-21) 17次浏览 已收录 0个评论

怎么使jupyter可以自动补全

使jupyter可以自动补全的方法:

Jupyter notebook使用默认的自动补全是关掉的。要打开自动补全,需修改默认配置。

<a href="https://www.gaodaima.com/tag/ipython" title="查看更多关于ipython的文章" target="_blank">ipython</a> profile create

www#gaodaima.com来源gaodai$ma#com搞$代*码*网搞代码

以上命令会在~/.ipython/profile_default/目录下生成ipython_config.py和ipython_kernel_config.py
我们需要修改的以下几行:

## Activate greedy completion PENDING DEPRECTION. this is now mostly taken care
#  of with Jedi.
#
#  This will enable completion on elements of lists, results of function calls,
#  etc., but can be unsafe because the code is actually evaluated on TAB.
c.Completer.greedy = True

## Experimental: restrict time (in milliseconds) during which Jedi can compute
#  types. Set to 0 to stop computing types. Non-zero value lower than 100ms may
#  hurt performance by preventing jedi to build its cache.
c.Completer.jedi_compute_type_timeout = 400

## Experimental: Use Jedi to generate autocompletions. Off by default.
c.Completer.use_jedi = True

重启jupyter后生效。

推荐学习:《python教程》

来源:搞代码网:原文地址:https://www.gaodaima.com


搞代码网(gaodaima.com)提供的所有资源部分来自互联网,如果有侵犯您的版权或其他权益,请说明详细缘由并提供版权或权益证明然后发送到邮箱[email protected],我们会在看到邮件的第一时间内为您处理,或直接联系QQ:872152909。本网站采用BY-NC-SA协议进行授权
转载请注明原文链接:怎么使jupyter可以自动补全

喜欢 (0)
[搞代码]
分享 (0)
发表我的评论
取消评论

表情 贴图 加粗 删除线 居中 斜体 签到

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址