gpt4 book ai didi

python - 在 Bash 中使用 Python Shell

转载 作者:行者123 更新时间:2023-12-01 00:02:59 25 4
gpt4 key购买 nike

我想在 bash 中使用 python shell(即执行 $ python 并在 bash 中按 Enter 键),但我注意到缺少一些可以提高我的工作效率的东西。

是否有任何已知资源可以解决任何(或全部)这些问题?

1) 没有自动缩进

当我写完后按回车

>>> for i in [1, 2]:

bash 不会自动缩进 4 个空格

2)奇怪的命令行历史记录

当我执行多行命令时:

>>> for i in [1, 2]:
... pass
...

我点击向上箭头来获取我的历史记录,而不是获取我得到的整个多行命令

...通过

3) 无语法着色

4)没有自动完成

最佳答案

尝试查看 ipython。它是终端中功能更丰富的 python shell。它可以使用 pip install ipython 进行安装,并通过输入 ipython 在终端中启动。请参阅文档 here了解更多详情。

关于python - 在 Bash 中使用 Python Shell,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60199907/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com