[Tutor] Learning about callbaks

2007-12-29 Thread Michael Bernhard Arp Sørensen
Hi there. I want to learn about callbacks because we use it at work in our software. I there a short hello world-like version of a callback example? -- Med venlig hilsen/Kind regards Michael B. Arp Sørensen Programmør / BOFH I am /root and if you see me laughing you better have a backup.

Re: [Tutor] Learning about callbaks

2007-12-29 Thread Michael Bernhard Arp Sørensen
Greetings, my master. I'm writing a game based on curses. I have my own screen object and several child objects to handle sub windows with e.g. menues, board/map/views and log outputs. All user input is done with screen.getch and later sent to the dynamic menu for selecting menu points. My

Re: [Tutor] Careful Dictionary Building

2007-12-29 Thread Reed O'Brien
On Dec 28, 2007, at 11:29 AM, doug shawhan wrote: *sigh* Ignore folks. I had forgotten about .has_key(). .has_key() is deprecated in 2.6 and goes away in 3.0 IIRC You should use record in D or D.get(record) On Dec 28, 2007 11:22 AM, doug shawhan [EMAIL PROTECTED] wrote: I'm building a

Re: [Tutor] Careful Dictionary Building

2007-12-29 Thread Paul McGuire
1. Don't name your dict 'dict' or your list 'list', as this then masks the builtin dict and list types. 2. Your application is a textbook case for defaultdict: from collections import defaultdict recordDict = defaultdict(list) for record in recordList: