Skip to content

Instantly share code, notes, and snippets.

@BlogBlocks
Last active December 19, 2017 00:23
Show Gist options
  • Save BlogBlocks/0d40cde2206255a9ae7f85038d7767f5 to your computer and use it in GitHub Desktop.
Save BlogBlocks/0d40cde2206255a9ae7f85038d7767f5 to your computer and use it in GitHub Desktop.
import sys
"""
Displays a range of lines in a file
USAGE:
"""
filename = sys.argv[1]
start = int(sys.argv[2])
end = int(sys.argv[3])
f = open(filename, "r")
lines = f.readlines()
count = 0
for line in lines:
count = count +1
if count > start:
line = line.replace("\n", "")
print count,"-",line
if count > end:break
@BlogBlocks
Copy link
Author

made public

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment