Advertisement
rfmonk

itertools_tee.py

Jan 15th, 2014
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.13 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. from itertools import *
  5.  
  6. r = islice(count(), 5)
  7. i1, i2 = tee(r)
  8.  
  9. print 'i1:', list(i1)
  10. print 'i2:', list(i2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement