我用 Python 编写了一个比较 3 个 excel 文件的脚本。我有很多文件要使用此脚本,并且我希望它们以三个一组的形式使用。到目前为止,它大致是这样的:
#!/usr/bin/env python
import sys
import csv
#lots of functions
resultsdir = "."
#bla
filename1=sys.argv[1]
filename2=sys.argv[2]
filename3=sys.argv[3]
out = open(sys.argv[4],"w")
#filename1,filename2,filename3="CNVB_reads.403476","CNVB_reads.403447","CNVB_reads.403478"
#these are the 3 files it uses at the moment
file1=open(resultsdir+"/"+filename1+".csv")
file2=open(resultsdir+"/"+filename2+".csv")
file3=open(resultsdir+"/"+filename3+".csv")
file1.readline()
file2.readline()
file3.readline()
#lots of other irrelevant stuff
#the output goes into an excel file as well
一般来说,我是编程新手,我希望当我试图解释我想做的事情时我是有意义的。为任何帮助干杯!