File: example1.py

package info (click to toggle)
logtop 0.7-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 200 kB
  • sloc: ansic: 1,426; python: 71; makefile: 54
file content (25 lines) | stat: -rw-r--r-- 424 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
#!/usr/bin/env python3

import pprint
import sys
from logtop import logtop


"""
This example show a complete usage of the python API,
It can be used like this:

$ make python-module
$ python3 -m venv logtop_venv
$ . logtop_venv/bin/activate
$ python3 -m pip install .
$
$ cat /etc/passwd | cut -d: -f7 | python3 examples/example1.py

"""

l = logtop(10000)
for line in sys.stdin:
    l.feed(line)

pprint.pprint(l.get(10))