如果我有下面的数据,用制表符分开打印
print str(z).translate(None,"([]){},\"'").replace(' ','\t')
0.016611783537845426 0.5728972505882961 0.1723653381777387 0.44730982873820446 10 11 10 0.016611783537845426 0.5728972505882961 0.2526385373738682 0.03281263933004819 10 12 10 0.016611783537845426 0.5728972505882961 0.509414248773428
我怎么能写一个新的txt文件,但开始新行每说4个标签。所以得到4列。在
已经尝试了\n but im rubbsih的许多变体。在
例如:
^{pr2}$为每个字符返回换行符。在
您可以使用^{} documentation 中的
grouper
配方:然后您可以将输出生成为:
^{pr2}$或者,如果要将其写入文件,请使用
f.writelines
:这应该是有效的:
相关问题 更多 >
编程相关推荐