Skip to content
This repository has been archived by the owner on Oct 5, 2018. It is now read-only.

le717/linescan.py

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

linescan.py

Easily read a text file using counting numbers.

linescan.py is a simple module designed to aid beginner programmers who need to read data from text files but have trouble setting up open() or translating real numbers to counting numbers.

Features

  • Uses counting numbers to denote line numbers instead of zero-based indexing
  • Simple API
  • Supports >= Python 3.6

Usage

import linescan

# Scan a single line using UTF-8 encoding
linescan.scan("MyFile.txt", 12, 12, encoding="utf-8")

# Scan multiple lines using default encoding
linescan.scan("MyFile.txt", 1, 12)

# Scan entire file
linescan.scan("MyFile.txt", 1)

# Passing a value of `True` will raise Exceptions instead of returning `False`
# Pass a value of `False` to restore default behavior
linescan.show_errors(True)

API Documentation

Complete API documentation is available on the wiki.

License

2013-2018 Caleb Ely

MIT