> ## Content Index
> Fetch the complete content index at: https://sanghunkang.com/llms.txt
> Use this file to discover other available public pages before exploring further.

# [python]cat을 이용해서 stdin 인풋 주기
- URL: https://sanghunkang.com/ko/feeding-stdin-input-using-python-cat-ko/
- Published: 2017-12-02T00:00:00.000Z
- Updated: 2026-08-31T10:05:48.000Z
- Author: Sanghun Kang
- Tags: dev, #ko, python

`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)