[Tutor] Using contents of a document to change file names, (was Re: how to extract data only after a certain ...)
joel.goldstick at gmail.com
Tue Oct 12 21:53:22 CEST 2010
On Tue, Oct 12, 2010 at 3:39 PM, Sander Sweers <sander.sweers at gmail.com>wrote:
> On 12 October 2010 21:15, Joel Goldstick <joel.goldstick at gmail.com> wrote:
> > When the dictionary is retrieved, its order depends on the hashed values
> > rather than the keys themself.
> If (big IF here) you really need an ordered dict you can use the
> OrderedDict from the collections module. However this will only
> guarantee *insertion* order (except for existing keys). Do make sure
> you read pep 372 .
>  http://www.python.org/dev/peps/pep-0372/
It seems a common practice to create an ordered list of the keys, then
iterate over the list to operate on the dictionary.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Tutor