[Tutor] os.path.walk vs unix find command

2008-08-15 Thread Angela Yang
Hi Python gurus: Is os.popen("find") faster or slower than os.path.walk to find file pattern in the directory tree?  I thought os.path.walk would be faster than unix find, but that doesn't seem to be the case? What is the fastest way in python to search for a file with a given pattern in

[Tutor] how do I create a lists of values associated with a key?

2008-08-01 Thread Angela Yang
Hi, I have a list of values for one key.  How do I specify this data structure? First tried, collection = [] collection['abby'].append('apprentice1') collection['abby'].append('apprentice2') That did not work because list index is not numeric. But for dictionaries, it is key - value