Basic use of Ipython

Source: Internet
Author: User

1. Help:

? : Overview and Introduction to Ipython

Help: Querying for assistance with the specified name

Obj? : Lists the details of the Obj object

Obj?? : List more detailed information

2. Special variables:

_ Indicates the previous output

__ indicates the second-to-last output

___ indicates the third-to-last output

_DH: Catalog History---return list

_oh: Output History---"Back to Dictionary"

3. Shell command:

! Command Execution Shell command (the current system's shell command) if the current system is wind, then many of the commands can not be executed, need to pass the additional configuration, the current system support shell command, if it is Linux, basic can be executed.

! Ls-l

! Touch A.txt

Files =!ls-l | grep py

4, Magic Method:

Ipython built-in special method with% percent sign

%magic format

% starts with the line magic

The cell Magic,notebook is the cell that starts with the percent

%alias defines an alias for a system command

Alias LL Ls-l

ll

%timeit statement

-N How many times a loop loop executes the statement

-R Loop executes how many loops to get the best results

%%timeit Setup_code

Code .... This is for the entire cell.

%CD Change current working directory, CD can be considered as%CD link, path history in _dh view

%pwd, PWD Displays the current working directory

%ls, LS Returns a list of files

Note:%PW This kind of thing magic method, is Ipython internal realization, and the exercise system is irrelevant, and! PWD relies on command execution provided by the shell of the current operating system, and default Windows does not support PWD

  

%%js,%%javascript run JS script in cell

%%js

Aleart (' a ' + 1)

Basic use of Ipython

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.