If you iterate over a dictionary, it will iterate over just the keys, not key-value tuples. You want to say "for name in array:" and then "print array[name]" and so forth. Alternatively, you could say "for (name, item) in array.items():" and then the rest of your code would work the way you want it to, since the dict.items method does return key-value tuples. The first way is more efficient, though.
EDIT:...
User Profile
Collapse
-
How to implement telephony?
Hi. I'm new here, so sorry if I do something wrong.
I'm trying to write a script that dials into a PBX (presumably using normal telephony) and plays an audio file into the phone. I've been looking for a module or other way to do this, but so far I haven't had any luck. I found a project called PyTele that looks like it does something similar to what I want, but I couldn't make it work; it seems to rely on an installation method (involving... -
Hi! This is my first post here. Looks like a good place.
I generally use Python 2.6.2 on Windows XP. I edit in IDLE, and as far as I know I don't have any other GUI toolkits.Leave a comment:
No activity results to display
Show More
Leave a comment: