Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/342.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在python中使用变量之间的制表符来创建包含3列的单行?_Python_Tabs - Fatal编程技术网

如何在python中使用变量之间的制表符来创建包含3列的单行?

如何在python中使用变量之间的制表符来创建包含3列的单行?,python,tabs,Python,Tabs,这基本上是我要打印的变量: 打印n、bu、qui 现在我有这样一个: 打印n“\t”,int(bu.total_seconds()*1000)”\t,int(qui.total_seconds()*1000)”\t“使用str.format: print "{}\t{}\t{}".format(n, int(bu.total_seconds() * 1000),int(qui.total_seconds() * 1000)) 您可以通过多种不同的方式对齐格式使用使用str.format: pr

这基本上是我要打印的变量:

打印n、bu、qui

现在我有这样一个:


打印n“\t”,int(bu.total_seconds()*1000)”\t,int(qui.total_seconds()*1000)”\t“
使用
str.format

print "{}\t{}\t{}".format(n, int(bu.total_seconds() * 1000),int(qui.total_seconds() * 1000))

您可以通过多种不同的方式对齐格式使用使用
str.format

print "{}\t{}\t{}".format(n, int(bu.total_seconds() * 1000),int(qui.total_seconds() * 1000))

您可以使用多种不同的方式对齐格式使用

不用担心,您可以使用str.format右对齐、左对齐和其他多种方式。不用担心,您可以使用str.format右对齐、左对齐和其他多种方式