IPython使用

In [14]: %timeit L = [n ** 2 for n in range(1000)]
362 µs ± 16.1 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)
In [17]: %run my_app.py
4356
In [26]: print(_)    # 历史的输出结果,第一,第二,第三
-2.185039863261519

In [27]: print(__)
-0.4161468365471424

In [28]: print(___)
0.9092974268256817
In [33]: math.sin(2) + math.cos(3); # 禁止一条命令的输出,行末加个;
# 这个结果被默默计算了,结果既不会显示在屏幕上,也不会存储在Out路径下

In [34]: 33 in Out
Out[34]: False

 

posted @ 2018-08-25 16:07  PLAY_JOY  阅读(171)  评论(0编辑  收藏  举报