Python processing each line from stdin or files

July 12, 2015 by Zemian Deng Comment

Tags: python

import fileinput,re
for line in fileinput.input():
line=line.rstrip()
line=line.replace('\\', '/')
a,b,*_=re.split('\s+', line)
print(b)