I have put together a few classes and a cmd.Cmd instance that works as a basic engine for interactive fiction/text adventures. The code is available on my Xenomind website as usual. The zip file that link goes to contains the p_machine package with the engine and elevator.py, a short sample adventure made with that engine.
Let me be clear about what this is and is not meant to be. This is not meant to be a full featured interactive fiction engine. It needs a lot of work before it can be anything like that: it's own interface, a broader and more flexible lexicon, a simple and embedded way to deal with doors, vehicles, group objects, at least a way to plug in a combat system, and who knows what else. Maybe I'll get around to writing something like that, but not today.
What this is meant to be is an answer to a common question. We are often asked "What's the problem with my text adventure?", and the answer is buried somewhere in a morass of 200 nested if statements. The usual answer is "learn classes." While that answer is correct, it's a bit short on details. We now have three brief tutorials on classes, and by the end of the week I hope to have a explanation here of how I wrote this program. Then we can give the more detailed answer of "read these tutorials on classes and the description of this program." So this is just meant to be a basic interactive fiction engine that a bright beginner could wrap their head around.