Answers for "convert text file to list in python"

1

txt to list python

with open('names.txt', 'r') as f:
    myNames = [line.strip() for line in f]
Posted by: Guest on July-11-2021
0

convert text file into list

crimefile = open(fileName, 'r')
yourResult = [line.split(',') for line in crimefile.readlines()]
Posted by: Guest on May-25-2021

Code answers related to "convert text file to list in python"

Python Answers by Framework

Browse Popular Code Answers by Language