Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

How to copy from a text file

I have abc.txt file contains

0,1,0,1,1,....,1

I want to store these numbers in an array. This code is not working:

f=open('path/abc.txt') L = f.readlines()

for i in range(len(L)):

 A.append(L[i])

Please help me.

How to copy from a text file

I have abc.txt a file contains abc.txt containing:

0,1,0,1,1,....,1

0,1,0,1,1,...,1

I want to store these numbers in an array. array.

This code is not working:

f = open('path/abc.txt')
L = f.readlines()
  

f=open('path/abc.txt') L = f.readlines()

for i in range(len(L)):

range(len(L)):
    A.append(L[i])

Please help me. me.