我有一个文件名数组,我想用 pyfits 打开每个文件。所以我的代码应该是这样的:
import pyfits
files=array(["1131lc.fits+2","1132lc.fits+2","1134lc.fits+2","1136lc.fits+2","1137lc.fits+2","1138lc.fits+2"])
for file in files:
data = pyfits.open(files)
print data
print len(data)
但是这样一来,最后两个命令,打印出来:“[]”和“0”。问题出在哪里?