V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
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
tedd
V2EX  ›  Python

如何将mac bash替换为iPython呢

  •  
  •   tedd · 2013-10-19 08:10:52 +08:00 · 5358 次点击
    这是一个创建于 3839 天前的主题,其中的信息可能已经有所发展或是发生改变。
    默认启动就让启动iPython,我搜了条命令但用了没有效果...

    exec /usr/local/bin/ipython -noconfirm_exit -p sh to my .bashrc
    7 条回复    1970-01-01 08:00:00 +08:00
    livelazily
        1
    livelazily  
       2013-10-19 09:09:41 +08:00   ❤️ 1
    terminal->Preferences->Settings->Shell->Startup->Run command
    这里填写启动的时候需要执行的命令
    alexrezit
        2
    alexrezit  
       2013-10-19 09:19:53 +08:00
    @livelazily
    正解. 顺便说一句, 用绝对路径.
    tedd
        3
    tedd  
    OP
       2013-10-19 09:39:50 +08:00
    @livelazily 原来如此,感谢了!
    但好像如果是默认iPython的话,有些命令就执行不了了?之前我看到别人打开django的shell命令后,在里面也可以用ipython,有tab自动补全这些功能,但好像现在我连django的shell都执行不了

    In [8]: python manage.py shell
    File "<ipython-input-8-c7c1a9bc8c9e>", line 1
    python manage.py shell
    ^
    SyntaxError: invalid syntax
    livelazily
        4
    livelazily  
       2013-10-19 09:51:48 +08:00   ❤️ 1
    @tedd 建议你看看这个 http://stackoverflow.com/a/3531548/902058
    ipython不是普通的shell,不能直接在里面跑"python"这个命令,要运行某个脚本试试"%run scriptfile.py"
    mengzhuo
        5
    mengzhuo  
       2013-10-19 10:37:34 +08:00   ❤️ 1
    @tedd 这种用法太可爱啊

    Ipython是Python Console的升级版而已
    shell请换zsh,一次拥有,终身不想换

    P.S. @livelazily 说的方法还要设置ENV才能启动django
    xiaket
        6
    xiaket  
       2013-10-19 11:45:43 +08:00
    简单地说, 不要这样做.
    ChiangDi
        7
    ChiangDi  
       2013-10-19 12:51:08 +08:00 via Android
    @xiaket 我也奇怪为什么这么做
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   我们的愿景   ·   实用小工具   ·   2008 人在线   最高记录 6543   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 27ms · UTC 16:20 · PVG 00:20 · LAX 09:20 · JFK 12:20
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.