简体   繁体   English

需要打印所有行

[英]need to print all rows

for row in rows[:5]:

This will give me the first 5 rows.这将给我前 5 行。 lets say I have a thousands rows - how can I print them all - what should I use between the square brackets?可以说我有几千行——我怎样才能把它们全部打印出来——我应该在方括号之间使用什么?

I am trying to print all rows but I am looking for something that will print the whole file regardless how big it is by default.我正在尝试打印所有行,但我正在寻找可以打印整个文件的东西,无论默认情况下它有多大。

You can just write你可以只写

for row in rows:
    ...

no need to apply a slice无需应用切片

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM