顯示具有 python 標籤的文章。 顯示所有文章
顯示具有 python 標籤的文章。 顯示所有文章

2014年6月24日 星期二

Python 標準輸入

#/usr/bin/env python 

import sys 

counter = 1 
while True: 
        line = sys.stdin.readline() 
        if not line: 
                break 
        print "%s:%s" % (counter,line) 
        counter += 1