推荐学习书目
› Learn Python the Hard Way
Python Sites
› PyPI - Python Package Index
› http://diveintopython.org/toc/index.html
› Pocoo
值得关注的项目
› PyPy
› Celery
› Jinja2
› Read the Docs
› gevent
› pyenv
› virtualenv
› Stackless Python
› Beautiful Soup
› 结巴中文分词
› Green Unicorn
› Sentry
› Shovel
› Pyflakes
› pytest
Python 编程
› pep8 Checker
Styles
› PEP 8
› Google Python Style Guide
› Code Style from The Hitchhiker's Guide
hihihihihi
V2EX  ›  Python

bpython 类似的程序, 能编辑多行吗?

  •  
  •   hihihihihi · Jul 9, 2016 · 3061 views
    This topic created in 3730 days ago, the information mentioned may be changed or developed.
    最近用 bpython 写代码, 代码提示用的很爽. 可是有一个问题是, 他能不能像文本编辑器那样编辑多行,然后再运行?

    比如, 我前面写了一个函数, 后面想再去编辑一下这个函数, 是不是就没办法?


    我知道 iPython Notebook, PCharme 可以实线这种功能, 但是,感觉用起来没 bpython 爽啊...
    8 replies  •  2016-07-12 08:32:40 +08:00
    syslot
        1
    syslot  
       Jul 9, 2016
    hihihihihi
        2
    hihihihihi  
    OP
       Jul 10, 2016
    楼上的可能没明白我的意思, 并不是当前的多行, 而是可以跳过去编辑之前的函数. 类似 VI, 一些 IDE 那样.

    可能反过来说就是 IPython, PyCharm 这些的代码提示都没 bpython 的好用.
    xiahei
        3
    xiahei  
       Jul 10, 2016
    - IDLE ,没有提示有补全。可以编辑多行。
    - 试试最新版的 IPython ,提示也很不错了。
    hihihihihi
        4
    hihihihihi  
    OP
       Jul 10, 2016
    命令行的一行一行解析存在一个问题,

    比如我前面写了一个函数

    def func(a,b):
    print(a)
    print(b)



    后面我也写了一些别的内容,我发现想修改一下这个函数的内容,就很头疼啊.
    syslot
        5
    syslot  
       Jul 10, 2016
    @4ever911 这样的话,貌似是需要重新输入代码,如果是这样,推荐还是用 editor 写好脚本,然后在 repl 内部载入脚本
    syslot
        6
    syslot  
       Jul 10, 2016
    <img width="1440" alt="screen shot 2016-07-10 at 5 24 08 pm" src="https://cloud.githubusercontent.com/assets/5219942/16712835/77c72e30-46c5-11e6-8c29-f39066ca4d5e.png">
    linhua
        7
    linhua  
       Jul 11, 2016
    用 emacs + org-mode org-babel ,, org-mode 里的代码块可以执行,输出在当前文件里。
    literate programming
    https://en.wikipedia.org/wiki/Literate_programming
    http://orgmode.org/worg/org-contrib/babel/
    aec4d
        8
    aec4d  
       Jul 12, 2016
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Privacy   ·   Solana   ·   2499 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 30ms · UTC 07:32 · PVG 15:32 · LAX 00:32 · JFK 03:32
    ♥ Do have faith in what you're doing.