Skip to content

moskytw/tacit

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

62 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Tacit

It provides the useful function, tac, which lets you read lines from end of file. It works like the tac command in the shell.

It reads file into a fixed buffer and yields lines orderly, so it is comportable to use on big file, e.g., large log.

Examples

The content of file:

The first line.
The second line.
The last line.

The code:

for line in open(path):
    print line,
print

from tacit import tac

for line in tac(path):
    print line,

The output:

The first line.
The second line.
The last line.

The last line.
The second line.
The first line.

There are more examples: /examples.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

No packages published