Answers for "how to read a data file in python and build a list of files"

0

how to read a data file in python and build a list of files

f = open("RandomNames.txt", "r") rowList = [] for line in f.readlines(): rowList.append(line[0:-1]) print(rowList) f.close() f = open("RandomNames.txt", "r") idList = [] for line in f.readlines(): temp = line.split(",") idList.append(int(temp[0])) print(idList) f.close()
Posted by: Guest on May-08-2020
0

how to read a data file in python and build a list of files

f = open("RandomNames.txt", "r") rowList = [] for line in f.readlines(): rowList.append(line[0:-1]) print(rowList) f.close() f = open("RandomNames.txt", "r") idList = [] for line in f.readlines(): temp = line.split(",") idList.append(int(temp[0])) print(idList) f.close()
Posted by: Guest on May-08-2020

Code answers related to "how to read a data file in python and build a list of files"

Python Answers by Framework

Browse Popular Code Answers by Language