join , split question

metal metal29a at gmail.com
Fri Nov 6 01:34:37 CET 2009


On 11月4日, 下午5时39分, elca <high... at gmail.com> wrote:
> Hello,
> i have some text file list such like following format.
> i want to change text format to other format.
>  i was upload it pastebin sitehttp://elca.pastebin.com/d71261168
>
> if anyone help ,much appreciate thanks in advance
> --
> View this message in context:http://old.nabble.com/join-%2C-split-question-tp26193334p26193334.html
> Sent from the Python - python-list mailing list archive at Nabble.com.

s = """uji708
uhodih
utus29
agamu4
azi340
ekon62
"""

from itertools import cycle
for i, x in zip(cycle(range(3)), s.splitlines()):
    print x + ',',
    if i == 2:
        print

"""
uji708, uhodih, utus29,
agamu4, azi340, ekon62,
"""



More information about the Python-list mailing list