Last active
December 19, 2017 00:23
-
-
Save BlogBlocks/0d40cde2206255a9ae7f85038d7767f5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
made public