Hi
I am new in python and want to see how this can be done in python (I can do this in R). I have a text file `myfile.txt` with one column and thousands of rows as shown below. I want to convert this to fasta `result.fasta` format as shown below. How can I do this in python?

`myfile.txt`

    ATGTGTGGTTTTCCCCC
    ATTGGCGGGGTTTTTCAGGGG
    ATGGGGGGGCCCCCCCCAAAAAA
    TTGGTGGGGGGGGGGGGAA


`result.fasta`

    
    >1
    ATGTGTGGTTTTCCCCC
    >2
    ATTGGCGGGGTTTTTCAGGGG
    >3
    ATGGGGGGGCCCCCCCCAAAAAA
    >4
    TTGGTGGGGGGGGGGGGAA
Something a bit simpler and should work in Python 2 and 3:

    #!/usr/bin/env python

    import sys

    c = 1
    for l in sys.stdin:
        sys.stdout.write(">%d\n%s\n" % (c, l))
        c += 1

Usage:

    $ convert.py < in.txt > out.fa