Skip to content

Instantly share code, notes, and snippets.

@theneosloth
Created February 24, 2013 02:30
Show Gist options
  • Save theneosloth/5022311 to your computer and use it in GitHub Desktop.
Save theneosloth/5022311 to your computer and use it in GitHub Desktop.
Text file reader
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