[python]cat을 이용해서 stdin 인풋 주기

[python]cat을 이용해서 stdin 인풋 주기
Photo by Rubaitul Azad / Unsplash

cat iris.txt | python test.py

import sys import re

pattern= r’^([(\d.)]+) - - [(.?)] “(.?) (.?) (.?)” (\d+) (\d+)’ for line in sys.stdin: data = line.strip() print(“1” + data)