[Tutor] Nested Lists / Array Module

Harm_Kirchhoff at mail.digital.co.jp Harm_Kirchhoff at mail.digital.co.jp
Tue Oct 21 20:07:57 EDT 2003


Python supports nested lists, which is very nice and can be used for very 
simple databases.

However, I could not find a way to write nested lists to files & retrieve 
them easily.
The .writelines() method expects a string as an argument.

Is there a method to dump any list on disk & read it back, or is it 
necessary to code this task ?

The array module seems to have such method, however, I could not find 
sufficient code examples to understand how the array module works. The 
Python Library Reference mentions the .fromfile() and .tofile() methods, 
does anyone have experience with the array module, especially whether it 
allows to write & retrieve nested arrays without problems ? Could you pass 
me some sample code ?

 
Harm 




More information about the Tutor mailing list