peter at engcorp.com
Wed Aug 20 17:32:53 CEST 2003
Thomas Güttler wrote:
> I want to parse a file that looks like this:
> a0001: basbasdb
> a0002: fffff
> a???? should be the key and the following lines should
> be the value of a dictionary.
> My solution looks like this:
> for match in matches:
> print match
> I think there is a better solution than this, don't you?
It depends. Does this solution work, and run acceptably quickly?
If so, there is no better solution. ;-)
(To put it another way: define "better".)
More information about the Python-list