IPython 使用記錄

記錄使用的一些技巧處理python

1 自動重載修改的文件

局部的會話中使用code

若是想在當前 ipython 會話中使用,則運行 ipython 後,依次鍵入下面語句便可ip

%load_ext autoreload
%autoreload 2

全局使用
若是想爲了懶省事,我但願 IPython 一直會自動重載,則須要修改io

/Users/allen/.ipython/profile_default/ipython_config.pyclass

中的配置,修改以下:module

## 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']

若是當前用戶目錄下沒有 .ipython 目錄,則可執行如下語句建立配置

ipython profile createfile


持續更新...技巧

相關文章
相關標籤/搜索