Last active
May 20, 2018 14:16
-
-
Save jzztf/8ad236a262ba9a57acc710667ef32a8c to your computer and use it in GitHub Desktop.
ipython config
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
#---------------------------------------------------- | |
# .ipython/profile_default/startup/00-prompts-start.py | |
#---------------------------------------------------- | |
# 参考: <https://ipython.readthedocs.io/en/stable/config/details.html#custom-prompts> | |
# 将此文件添加到".ipython/profile_default/startup/"即可 | |
from IPython.terminal.prompts import Prompts, Token | |
class MyPrompt(Prompts): | |
def in_prompt_tokens(self,cli=None): | |
return [(Token.Prompt,'In :')] | |
def out_prompt_tokens(self,cli=None): | |
return [(Token.Prompt,'Out:')] | |
ip = get_ipython() | |
ip.prompts = MyPrompt(ip) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#---------------------------------------------------- | |
# .ipython/profile_default/ipython_config.py | |
#---------------------------------------------------- | |
## lines of code to run at IPython startup. | |
c.InteractiveShellApp.exec_lines = ['autoreload 2'] | |
## A list of dotted module names of IPython extensions to load. | |
c.InteractiveShellApp.extensions = ['autoreload'] | |
## Whether to display a banner upon starting IPython. | |
c.TerminalIPythonApp.display_banner = False | |
## | |
#c.InteractiveShell.separate_in = '\n' | |
c.InteractiveShell.separate_in = '' | |
## Set the editor used by IPython (default to $EDITOR/vi/notepad). | |
c.TerminalInteractiveShell.editor = 'nano' | |
#---------------------------------------------------- | |
# shell中的操作 | |
#---------------------------------------------------- | |
# "$ ipython profile create" | |
# 创建默认的profile | |
# "$ ipython profile create foo" | |
# 创建自定义profile | |
# "$ ipython --profile=foo" | |
# 使用自定义profile |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
manage profile