- LineCache caches the line position of a file in the memory. Everytime it access a line, it will seek to the related postion and readline().
Noticing that it may cost some time when you first cache lines of a file.
Usage:
from linecache_light import LineCache
linecache = LineCache(‘a.txt’, cache_suffix=’.cache’)
num_lines = len(linecache)
line_0 = linecache[0]
line_100 = linecache[100]
line_indexing= linecache[[2,3,4,5]]
line_indexing = linecache[-1]
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
File details
Details for the file linecache-light-0.1.4.linux-x86_64.tar.gz.
File metadata
- Download URL: linecache-light-0.1.4.linux-x86_64.tar.gz
- Upload date:
- Size: 3.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.1.1 pkginfo/1.4.2 requests/2.22.0 setuptools/41.0.1 requests-toolbelt/0.9.1 tqdm/4.42.1 CPython/3.6.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e63e54fe5d0f534fd8248dc16e8fe084f9c554cf940952af723fe5a7d6920c5b
|
|
| MD5 |
5abfc7436225e13203a85833aefc7ec7
|
|
| BLAKE2b-256 |
d7ec146bb07c8ca9b6e45d85413613800557ad383ac3b3333abbf750f986cdb1
|