grapevine 1.0 documentation

head

«  grep   ::   Contents   ::   nl (a.k.a. nl1)  »

head¶

yield the first items

Usage¶

  • <iterable> | head[<int>]

Examples¶

>>> from grapevine import *
>>> ('foo', 'bar', 'quux') | head(2) | tuple
('foo', 'bar')
>>> ('foo', 'bar', 'quux') | head(-2) | tuple
('foo',)

See also

  • tail
  • select
  • GNU coreutils: head

«  grep   ::   Contents   ::   nl (a.k.a. nl1)  »

© Copyright 2007-2012, Jakub Wilk. Created using Sphinx 1.3.1.