Answers for "how to convert a txt string to list"

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 "how to convert a txt string to list"

Python Answers by Framework

Browse Popular Code Answers by Language