Advertisement
Guest User

working ipython session 2.6.1

a guest
Aug 11th, 2011
131
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.81 KB | None | 0 0
  1. Python 2.6.1 (r261:67515, Jun 24 2010, 21:47:49)
  2. Type "copyright", "credits" or "license" for more information.
  3.  
  4. IPython 0.11 -- An enhanced Interactive Python.
  5. ? -> Introduction and overview of IPython's features.
  6. %quickref -> Quick reference.
  7. help -> Python's own help system.
  8. object? -> Details about 'object', use 'object??' for extra details.
  9.  
  10. In [1]: from time import sleep
  11.  
  12. In [2]: def sleep2(time):
  13. ...: def sleep3():
  14. ...: sleep(time)
  15. ...: return time
  16. ...: return sleep3
  17. ...:
  18.  
  19. In [3]: sleep2(2)
  20. Out[3]: <function __main__.sleep3>
  21.  
  22. In [4]: sleep2(2)()
  23. Out[4]: 2
  24.  
  25. In [5]: [sleep2(i) for i in range(1,5)]
  26. Out[5]:
  27. [<function __main__.sleep3>,
  28. <function __main__.sleep3>,
  29. <function __main__.sleep3>,
  30. <function __main__.sleep3>]
  31.  
  32. In [6]:
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement