basename? Type: function String Form:<function basename at 0x004C86F0> File: c:\users\user\v\ipython-pywaw\lib\ntpath.py Definition: basename(p) Docstring: Returns the final component of a pathname
In [8]: print spam 5.19615242271 In [9]: %history 6-8 import math spam = math.sqrt(27) print spam In [10]: %save test.py 6-8 The following commands were written to file `test.py`: import math spam = math.sqrt(27) print spam
%logstart Activating auto-logging. Current session state plus future input saved. Filename : ipython_log.py Mode : rotate Output logging : False Raw input log : False Timestamping : False State : active In [2]: x = 5 In [3]: Do you really want to exit ([y]/n)? y
1.txt ? 2.txt In [12]: lines = !hg st In [13]: files = lines.grep(r'^\?').fields(1) In [14]: files Out[14]: ['1.txt', '2.txt'] In [15]: !rm $files.s In [16]: !ls hello.txt
1]: ....: return 1 ....: else: ....: return n * factorial(n - 1) ....: In [14]: %timeit factorial(120) 10000 loops, best of 3: 32.5 us per loop In [28]: def factorial2(n): ....: return reduce(operator.mul, xrange(1, n + 1)) ....: In [29]: %timeit factorial2(120) 100000 loops, best of 3: 15.9 us per loop