“Python Leer Archivo de texto Siguiente línea” Código de respuesta

Python Leer Archivo de texto Siguiente línea

filepath = 'Iliad.txt'
with open(filepath) as fp:
   line = fp.readline()
   cnt = 1
   while line:
       print("Line {}: {}".format(cnt, line.strip()))
       line = fp.readline()
       cnt += 1
Funny Frog

Python Leer Archivo de texto Siguiente línea

filepath = 'Iliad.txt'
with open(filepath) as fp:
   line = fp.readline()
   cnt = 1
   while line:
       print("Line {}: {}".format(cnt, line.strip()))
       line = fp.readline()
       cnt += 1
Glenn Hefley

Respuestas similares a “Python Leer Archivo de texto Siguiente línea”

Preguntas similares a “Python Leer Archivo de texto Siguiente línea”

Más respuestas relacionadas con “Python Leer Archivo de texto Siguiente línea” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código