001、
[root@pc1 test01]# ls a.fa test.py [root@pc1 test01]# cat a.fa ATCC GGGC ATGG AAGC TTGG ATGC ATGG [root@pc1 test01]# cat test.py #!/usr/bin/env python3 # -*- coding: utf-8 -*- in_file = open("a.fa", "r") file = in_file.readlines() length = len(file[0].strip()) list1 = ["" for i in range(length)] for i in file: i = i.strip() for j in range(len(i)): list1[j] += i[j] for i in list1: print(i) [root@pc1 test01]# python3 test.py AGAATAA TGTATTT CGGGGGG CCGCGCG
标签:test01,转置,pc1,python,file,test,py,文本,root From: https://www.cnblogs.com/liujiaxin2018/p/17696322.html