程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python Appendix B more about IPython

編輯:Python

The first 2 In the chapter , We learned IPython shell and Jupyter notebook The basis of . In this chapter , We will explore IPython Deeper functions , From the console or in jupyter Use .

B.1 Use command history

Ipython Maintains a small database on disk , Used to save each instruction executed . Its uses are :

  • With minimal input , You can search 、 Complete and execute previously run instructions ;
  • In different session Save command history ;
  • Enter the log into / Output history to a file

These functions are shell in , than notebook More useful , because notebook The design is to put the input and output code into each code grid .

Search and reuse command history

Ipython It allows you to search and execute previous code or other commands . This function is very useful , Because you may need to repeat the same command , for example %run command , Or other codes . Suppose you have to perform :

In[7]: %run first/second/third/data_script.py

  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved