Converting a string into a list in Python

Posted by Sam on Stack Overflow See other posts from Stack Overflow or by Sam
Published on 2010-03-30T13:11:45Z Indexed on 2010/03/30 13:13 UTC
Read the original article Hit count: 206

Filed under:

I have a text document that contains a list of numbers and I want to convert it to a list. Right now I can only get the entire list in the 0th entry of the list, but I want each number to be an element of a list. Does anyone know of an easy way to do this in Python?

1000
2000
3000
4000

to

['1000','2000','3000','4000']

© Stack Overflow or respective owner

Related posts about python