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
Create a new script called `ConvertFASTA.py`:

    import sys
    
    #File input
    fileInput = open(sys.argv[1], "r")
    
    #File output
    fileOutput = open(sys.argv[2], "w")
    
    #Seq count
    count = 1 ;
    
    #Loop through each line in the input file
    print "Converting to FASTA..."
    for strLine in fileInput:
    
    	#Strip the endline character from each input line
    	strLine = strLine.rstrip("\n")
    
    	#Output the header
    	fileOutput.write(">" + str(count) + "\n")
    	fileOutput.write(strLine + "\n")
    
    	count = count + 1
    print ("Done.")
    
    #Close the input and output file
    fileInput.close()
    fileOutput.close()


Then, run it with:

    python ConvertFASTA.py myfile.txt result.fasta