Loading a Python collection from an text-file

Ilias Lazaridis ilias at lazaridis.com
Mon Jan 23 14:00:55 EST 2006


within a python script, I like to create a collection which I fill with 
values from an external text-file (user editable).

How is this accomplished the easiest way (if possible without the need 
of libraries which are not part of the standard distribution)?

something like:

text-file:
{peter, 16},
{anton, 21}

-

within code:

users.load(text-file.txt)

for user in users
   user.name
   user.age

.

-- 
http://lazaridis.com



More information about the Python-list mailing list