On 8/28/07, Nagarajan <[EMAIL PROTECTED]> wrote: > A simple yaml file might just do the trick. > Your yaml file shall look like the following: > > Word-def.yaml > word1: word1's definition > word2: word2's definition > .. > .. > .. > Use pyyaml to handle yaml files. > -------- > import yaml > worddefs = yaml.load( open( "word-def.yaml", "r" ).read() ) > print worddefs > --------
I agree with the suggestion for yaml! Since definitions are to be inputed by the users, it could be better to use yaml.safe_load() to reduce the risks... francesco -- http://mail.python.org/mailman/listinfo/python-list