7

有没有办法更改配置文件以使 jupyter qtconsole 在启动时运行以下命令?:

%matplotlib inline
4

3 回答 3

10

将此行添加到ipython_config.py文件(不是ipython_qtconsole_config.py文件):

c.InteractiveShellApp.matplotlib = 'inline'
于 2015-10-26T19:52:56.700 回答
4

在您的ipython_config.py文件中,您可以通过设置指定在启动时运行的命令(包括魔术 % 命令)c.InteractiveShellApp.exec_lines。例如,

c.InteractiveShellApp.exec_lines = """
%matplotlib inline
%autoreload 2
import your_favorite_module
""".split('\n')
于 2016-01-20T14:30:29.520 回答
1

打开文件~/.ipython/profile_default/ipython_config.py,然后

c.InteractiveShellApp.code_to_run = ''

==>

c.InteractiveShellApp.code_to_run = '%pylab inline'
于 2017-03-30T04:19:30.797 回答