Re: [Tutor] Using contents of a document to change file names, (was Re: how to extract data only after a certain ...)

2010-10-12 Thread Joel Goldstick
On Tue, Oct 12, 2010 at 3:39 PM, Sander Sweers wrote: > On 12 October 2010 21:15, Joel Goldstick 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 > OrderedDic

Re: [Tutor] Using contents of a document to change file names, (was Re: how to extract data only after a certain ...)

2010-10-12 Thread Sander Sweers
On 12 October 2010 21:15, Joel Goldstick 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 *i

Re: [Tutor] Using contents of a document to change file names, (was Re: how to extract data only after a certain ...)

2010-10-12 Thread Joel Goldstick
On Tue, Oct 12, 2010 at 2:46 PM, Josep M. Fontana wrote: > > > On Tue, Oct 12, 2010 at 8:37 PM, Joel Goldstick > wrote: > >> >> >> On Tue, Oct 12, 2010 at 1:52 PM, Josep M. Fontana < >> josep.m.font...@gmail.com> wrote: >> >>> Thanks Chris and Alan, >>> >>> OK, I see. Now that I managed to build

Re: [Tutor] Using contents of a document to change file names, (was Re: how to extract data only after a certain ...)

2010-10-12 Thread Joel Goldstick
On Tue, Oct 12, 2010 at 1:52 PM, Josep M. Fontana wrote: > Thanks Chris and Alan, > > OK, I see. Now that I managed to build the dictionary, I did a print to > confirm that indeed the dictionary was created and it had the intended > contents and I was surprised to see that the order of the items

Re: [Tutor] Using contents of a document to change file names, (was Re: how to extract data only after a certain ...)

2010-10-12 Thread Josep M. Fontana
Thanks Chris and Alan, OK, I see. Now that I managed to build the dictionary, I did a print to confirm that indeed the dictionary was created and it had the intended contents and I was surprised to see that the order of the items in it was totally changed. So the text file from which the dictionar

Re: [Tutor] Using contents of a document to change file names, (was Re: how to extract data only after a certain ...)

2010-10-11 Thread Alan Gauld
"Josep M. Fontana" wrote I tried your suggestion of using .split() to get around the problem but I still cannot move forward. fileNameCentury = open(r '/Volumes/DATA/Documents/workspace/GCA/CORPUS_TEXT_LATIN_1/FileNamesYears.txt' .split('\r')) You are trying to split the filename not th

Re: [Tutor] Using contents of a document to change file names, (was Re: how to extract data only after a certain ...)

2010-10-11 Thread Christian Witts
On 11/10/2010 13:46, Josep M. Fontana wrote: I tried your suggestion of using .split() to get around the problem but I still cannot move forward. I don't know if my implementation of your suggestion is the correct one but here's the problem I'm having. When I do the following: ---

Re: [Tutor] Using contents of a document to change file names, (was Re: how to extract data only after a certain ...)

2010-10-11 Thread Josep M. Fontana
Sorry about the confusion with the subject line. I was receiving messages in digest mode and I copied and pasted the wrong heading in my previous message. Now I have written the heading corresponding to my initial message. I have also changed the settings for this list from the digest mode to the