Created
February 24, 2013 02:30
-
-
Save theneosloth/5022311 to your computer and use it in GitHub Desktop.
Text file reader
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,time,os | |
try: | |
file = open(sys.argv[1]) | |
except IndexError: | |
print "Error: please provide a file" | |
raw_input( "Press any key to exit") | |
print "Opened {0}".format(sys.argv[1]) | |
lines = "" | |
def PrintLine(line): | |
global lines | |
word = "" | |
for char in line: | |
time.sleep(0.1) | |
os.system("cls") | |
print lines | |
word+=char | |
print(word) | |
lines += word | |
for line in file: | |
PrintLine(line) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment