By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,593 Members | 1,575 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,593 IT Pros & Developers. It's quick & easy.

Re: Very simple - please help

P: n/a
On Nov 8, 12:24 pm, "Chris Rebert" <c...@rebertia.comwrote:
The code you gave works perfectly:
Weird! Doesn't work at all on my system (WinXP, Python 2.5).
Please post some of the actual code so that we can determine the problem.
Taking a guess, I'd suspect Blah and commands are in different modules
Nope, that was the actual code - in fact it was the whole program.
Nov 8 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
On Nov 8, 7:21*pm, pineapple <pineapple.l...@yahoo.comwrote:
On Nov 8, 12:24 pm, "Chris Rebert" <c...@rebertia.comwrote:
The code you gave works perfectly:

Weird! Doesn't work at all on my system (WinXP, Python 2.5).
Please post some of the actual code so that we can determine the problem.
Taking a guess, I'd suspect Blah and commands are in different modules

Nope, that was the actual code - in fact it was the whole program.
You haven't shown *ALL* of what you think you typed. Here's a copy/
paste from my console:
=== start ===
C:\junk>ver

Microsoft Windows XP [Version 5.1.2600]

C:\junk>python
Python 2.5.2 (r252:60911, Feb 21 2008, 13:11:45) [MSC v.1310 32 bit
(Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>class Blah(list):
.... pass
....
>>commands = {1: (lambda: Blah())}
commands
{1: <function <lambdaat 0x00B97E70>}
>>commands[1]
<function <lambdaat 0x00B97E70>
>>commands[1]()
[]
>>cx = {42:Blah}
cx[42]()
[]
>>>
Now, what results do you get?
Nov 8 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.