¡@

Home 

python Programming Glossary: prevline

Making a Python script Object-Oriented

http://stackoverflow.com/questions/1813117/making-a-python-script-object-oriented

import sys tokenList open sys.argv 1 'r' cleanedInput '' prevLine 0 for line in tokenList if line.startswith 'LINE ' lineNo int.. 'LINE ' lineNo int line.split ' ' 1 1 .strip diff lineNo prevLine 1 if diff 0 cleanedInput ' n' if diff 1 cleanedInput ' n n'.. if diff 1 cleanedInput ' n n' else cleanedInput ' n' diff prevLine lineNo continue cleanedLine line.split ' ' 1 1 .strip cleanedInput..