python convert a long numeric txt file like for example the first 16 million Pi numbers and save it to a list
import pandas as pd
file='/home/pp/Pictures/pi.txt'
read_file=pd.read_csv(file)
for row in read_file:
print(','.join(row))
python convert a long numeric txt file like for example the first 16 million Pi numbers and save it to a list
import pandas as pd
file='/home/pp/Pictures/pi.txt'
read_file=pd.read_csv(file)
for row in read_file:
print(','.join(row))
If each line in the file is a digit, then
with open(file, 'r') as f:
digits = f.readlines()
If you need to split the digits (not just one digit per line in the file)
with open(file, 'r') as f:
digits = list(f.readlines()[0])