reading numbers from file

Jacek Popławski jp at ulgo.koti.com.pl
Fri Dec 22 01:27:06 CET 2000


I have file with numbers:

23 41 24 0 2 42 532 53 234
34 234 53 23 4 323 53 (etc...)

1.How to read one line of this file and write it to list of numbers?
  (like: a=[23,41,24...])
2.How to read only 5 numbers, write it to list, then another 5, and write
  it to second list?
3.What will change if I want to add comments (#) and empty lines to my file?

-- 
Don't care which God you follow 
Whose promises you swallow
Time and again  
We must meet at the end              "Lord of the Last Day" - Ronnie James Dio



More information about the Python-list mailing list