ipython basic

[b]Introspection[/b][quote]
Using a question mark ( ? ) before or after a variable will display some general information about the object[/quote]
[quote]Using ?? will also show the function’s source code if possible:[/quote]
[quote]? has a final usage, which is for searching the IPython namespace in a manner similar to the standard UNIX or Windows command line. A number of characters combined with the wildcard ( * ) will show all names matching the wildcard expression.[/quote]

[b]Magic Command[/b]
[table]
|%quickref | Display the IPython Quick Reference Card
|%magic | Display detailed documentation for all of the available magic commands
|%debug | Enter the interactive debugger at the bottom of the last exception traceback
|%hist | Print command input (and optionally output) history
|%pdb | Automatically enter debugger after any exception
|%paste | Execute pre-formatted Python code from clipboard
|%cpaste | Open a special prompt for manually pasting Python code to be executed
|%reset | Delete all variables / names defined in interactive namespace
|%page | OBJECT Pretty print the object and display it through a pager
|%run | script.py Run a Python script inside IPython
|%prun | statement Execute statement with cProfile and report the profiler output
|%time | statement Report the execution time of single statement
|%timeit | statement Run a statement multiple times to compute an emsemble average execution time. Useful for timing code with very short execution time
|%who, %who_ls, %whos | Display variables defined in interactive namespace, with varying levels of information / verbosity
|%xdel | variable Delete a variable and attempt to clear any references to the object in the IPython internals
[/table]

[b]Matplotlib Integration and Pylab Mode[/b]
[quote]ipython --pylab[/quote]

[b]Searching and Reusing the Command History[/b]
<Ctrl-P> <up arrow>
<Ctrl-N> <down arrow>
<Ctrl-R>

[b]Input and Output Variables[/b]
[quote]IPython stores references to both the input (the text that you type) and output (the object that is returned) in special variables. The previous two outputs are stored in the _ (one underscore) and __ (two underscores) variables, respectively[/quote]
[quote]
Input variables are stored in variables named like _iX , where X is the input line number. For each such input variables there is a corresponding output variable _X . So after input line 27, say, there will be two new variables _27 (for the output) and _i27 for the input.[/quote]

[b]Logging the Input and Output[/b]
[quote]IPython is capable of logging the entire console session including input and output.Logging is turned on by typing %logstart, %logoff, %logon, %logstate, and %logstop .[/quote]

[b]Tips[/b]

[quote]import some_lib
reload(some_lib)[/quote]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值