[Python] How to print only first few lines of output through Python code?

Discussão em 'Python' iniciado por Stack, Março 16, 2025.

  1. Stack

    Stack Membro Participativo

    Is there a special method/function to print only first few lines of output in Python 2.7? We know that in terminal we could do that through head -3 for seeing first 3 lines. Do I have to just write a Python for loop?

    Continue reading...

Compartilhe esta Página