Loading [MathJax]/jax/output/HTML-CSS/jax.js

Ярлыки

суббота, 3 ноября 2012 г.

stdin stdout in Python


import sys
import time
import copy
import csv
import re
while True:
#get string from stdin

    s=sys.stdin.readline
    sss=str(word).strip()forwordins.splitlines(False)
#if string="Q", than exit

    if sss0=='Q': break
    try:
        for ss in sss:
#with regexp parse string
            pattern=re.compile(\d6;(\d{6})$')
            u=pattern.searchss.groups
            try:
#data to our function
                seq1,seq2=getSequ[0],u[1]
            except:
                stseq1=list
                trseq1=list
#send results to stdout
            print;.join(str(j for j in seq1) ,sep=';', end='\n', file=sys.stdout)
            print;.join(str(j for j in seq2) ,sep=';', end='\n', file=sys.stdout)

Комментариев нет:

Отправить комментарий