Easy question

Sean 'Shaleh' Perry shaleh at valinux.com
Wed Apr 11 17:03:58 EDT 2001


On 11-Apr-2001 Duncan Smith wrote:
> I need to read some data from a file.  Each (tab delimited) row corresponds
> to an array index eg.
> 
> 0    0    0    0    0    0
> 0    1    0    0    0    0
> 0    0    1    0    0    0
> ...
> 
> And I need something like,
> 
> [[0,0,0,0,0,0], [0,1,0,0,0,0], [0,0,1,0,0,0], ...]
> 
> What's the best way of doing this?  Cheers in advance.
> 

look at string.split().




More information about the Python-list mailing list