IPthon help and documentation
- Using a symbol? Get the document
- Use symbol?? Get the source code (when the query object is not implemented in Python, but implemented in C or another compiled extension language, the suffix?? Equivalent to?)
- The TAB completion
- TAB completion of object content
- You can narrow the match by entering the first or first few characters of the property or method name
- An underscore indicates a private property or method
- Automatic TAB completion during import
- Wildcard * matches (matches any string, including empty strings)
- TAB completion of object content
Shortcuts in IPython shell
Implemented through IPthon's dependency on the GNU Readline libraryCopy the code
- Navigation shortcut
- Text input shortcut keys
- Command history shortcut keys
Ctrl+ R goes beyond the current session to access the SQLite database stored in the Ipython configuration file path
- other
IPython magic command
- Line magic: prefixed with a single character % on a single line of input.
- Unit magic: prefixed with two %% s on multiple lines of input
- Paste code blocks: %paset and %cpaste
- The %paste command enters and executes the copied code
- The %cpaste command turns on the interactive multi-line input prompt
- Execute external code: %run
- %run [py filename]
- Calculate the code runtime: %timeit
- %timeit: Automatically calculates the execution time of the next line of Python statements
- %%timeit: used for multi-line statements
- List synthesis is faster than the equivalent for loop
- Magic function help:? Magic, % and % lsmagic
- %magic: Gets descriptions and examples of all available magic functions
- %lsmagic: Gets a list of all available magic functions
Input and output history
- Input-output object
- When In is printed, the first element of the list is a placeholder so that In[1] represents the first instruction
- In for list, Out for dictionary (no output without value)
- Reference the previous result directly using the index Out[n]
- Underscore shortcut key
- Gets the previous output and skips instructions that have no output. The number of underscores within three is the first several outputs
- If there are more than three, use line numbers (short for Out[X] : _X
- Disallow output: semicolon ‘; ‘, the output will not be displayed on the screen or stored in the Out path
- Related magic command
- %histry
%history -n 1-8# represents input from one to eight
- %save
- %rerun