Skip the First Line in a Text File Using Python 3

0Shares

By using the below Python 3 code snippet, you can easily skip the first line of a text file.

code.py

a_file = open("example_file.txt")

next(a_file)
for line in a_file:
    print(line.rstrip())
0Shares

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.