Q:

My python script when executed prints values to a single column of the excel document in which it is opened

I've been attempting to copy over lines from a csv(comma delimited) to another csv file after performing a simple check. But, the newly created output happens to be in a single column. How can I fix this? I've already attempted to migrate over values using the text solution in excel with no positive results. What I provided in the block quotes is one sample csv input that would be in ~400mb file that would need to be read for the given condition before being copied if the condition is met to the second file. 

"Glyma0022s00420.1,1932,1932,1,5.397348971,9.108346736,13.06778834,13.60298787,0.77651741,0.117442453,11.76078538,8.366009655,10.94107876,12.25047115,0.985502816,0.938466273,11.36138317,9.161105262,15.77093455,14.41819843,0.727405702,0.019170303,12.43972822,16.69100507,0.714607056,0.403279462,""osi,rcom,"",gi|225423945|ref|XP_002279093.1| PREDICTED: hypothetical protein [Vitisvinifera],No hit,""tr|B9ST04|B9ST04_RICCO DNA binding protein,>putative OS=Ricinus communisGN=RCOM_0353100 PE=4 SV=1"",""PF01426,PF05641"",None,None,None,None,AT1G68580.1,None,agenet domain-containing protein / bromo-adjacent homology (BAH) domain-containing protein,PF01426|PF05641 BAH domain|Agenet domain

This would be sample input
#!/usr/bin/env 

import csv
from sys import argv
script, filename = argv

def pvalueselection(file_in, file_out):
    header = True
    for line in file_in:
        line_split = line.split(',')
        if(header):
            file_out.writerow([line])
            header = False
            continue
        else:
            if float(line_split[9]) <=0.05 or float(line_split[15])<=0.05 or float(line_split[21]) <=0.05 or float(line_split[25])<=0.05:
                file_out.writerow([line])

def main():
    file_in = open(filename, 'rb')

    file_out = open ("output.csv",'wb') 
    csv_out = csv.writer(file_out,dialect='excel',delimiter=',')

    pvalueselection(file_in,csv_out)

    file_in.close()
    file_out.close()        

if __name__ == '__main__': main()   

A:

file_out.writerow([line]) will create a list with only one element 
for example 
In [1]: test = "1,2,3,4,5,6,7"
In [2]: list_test = [test]
Out[2]: ['1,2,3,4,5,6,7']
In [6]: len(list_test)
Out[6]: 1

what you need is a list of the delimiter separated elements. Use the list after line.split(",") in your code would return such list, using the split will solve the problem, for example in the following code
In [1]: test = "1,2,3,4,5,6,7"
In [2]: list_test = test.split(",")
In [3]: print list_test
out:   ['1', '2', '3', '4', '5', '6', '7']

#now use the writerow method to write the list
file_out.writerow(list_test)

The reference documentation has more examples about the usage
https://docs.python.org/3/library/csv.html

