Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

py for line in file

SAMPLE.TXT
This is
an existing file.

with open("sample.txt", "r") as a_file:
  for line in a_file:
    stripped_line = line.strip()
    print(stripped_line)

>>> This is
>>> an existing file.
Source by www.kite.com #
 
PREVIOUS NEXT
Tagged: #py #line #file
ADD COMMENT
Topic
Name
2+9 =