Where do I put IPython configuration files?

浪子不回头ぞ 提交于 2019-12-20 18:13:10

问题


I have been trying to set my %edit editor to Emacs for a while and made very slow progress.

The IPython 0.13 docs were unclear about how to actually configure this. It told me to set EDITOR to the desired editor (in my case, "emacsclient") by adding

c = get_config()
c.InteractiveShell.editor = 'emacsclient'

to my config in my ipython folder.

However, I couldn't find any such folder. I spent a very long time looking around to find just how to set IPython environment variables and found only related snippets. What code to use. The difference between .py and .ipy files for startup scripts. Etc.

I am using Ubuntu 12.10. Where do I put my config file for IPython 0.13?


回答1:


I have c.TerminalInteractiveShell.editor = 'emacsclient' in ~/.config/ipython/profile_default/ipython_config.py and it works.

If you have trouble finding config location, use ipython locate profile command: http://ipython.org/ipython-doc/rel-0.13/whatsnew/version0.13.html#new-top-level-locate-command

But I think the easiest way to setup editor is to have something like export EDITOR=emacsclient in your shell setup (e.g. ~/.bashrc).



来源:https://stackoverflow.com/questions/15403523/where-do-i-put-ipython-configuration-files

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!