我使用了一个生成器来创建 s
s= generator(n)
对于范围(n)内的 n,生成器产生(a,b)。其中 a=[w,x] 和 b=[y,z]
打印使用
for i in s:
print i
这返回:
([0.27704232355167768, 0.44459304959240675], [0.4387731877846518, 0.38108111684466683])
([0.27704232355167768, 0.44459304959240675], [0.6362447250743466, 0.72047209074359853])
([0.27704232355167768, 0.44459304959240675], [0.65419386891877318, 0.025362727486327286])
([0.27704232355167768, 0.44459304959240675], [0.039966264334369672, 0.9662795347591735])
不过我想
0.27704232355167768 0.44459304959240675 0.4387731877846518 0.38108111684466683
0.27704232355167768 0.44459304959240675 0.6362447250743466 0.72047209074359853
0.27704232355167768 0.44459304959240675 0.65419386891877318 0.025362727486327286
0.27704232355167768 0.44459304959240675 0.039966264334369672 0.9662795347591735
我尝试了以下想法的许多变体
print '\n'.join('\t'.join(x) for x in s)
但是为了 n0 有用并且倾向于以相同的格式返回 s。谁能帮我解决这个问题?