Popular recipes tagged "dictionaries" but not "unpack"http://code.activestate.com/recipes/tags/dictionaries-unpack/2008-12-20T11:18:35-08:00ActiveState Code RecipesDot-style nested lookups over dictionary based data structures (Python)
2008-12-14T14:32:59-08:00David Mosshttp://code.activestate.com/recipes/users/4124829/http://code.activestate.com/recipes/576586-dot-style-nested-lookups-over-dictionary-based-dat/
<p style="color: grey">
Python
recipe 576586
by <a href="/recipes/users/4124829/">David Moss</a>
(<a href="/recipes/tags/access/">access</a>, <a href="/recipes/tags/attribute/">attribute</a>, <a href="/recipes/tags/dictionaries/">dictionaries</a>).
Revision 2.
</p>
<p>This recipe allows you to present dictionary based nested data stuctures in your Python code as objects with nested attributes.</p>
<p>It provides dot ('.') based attribute lookups, like this :-</p>
<pre class="prettyprint"><code>>>> x = d.foo.bar.baz
</code></pre>
<p>instead of the usual (and longer) Python dictionary syntax lookups :-</p>
<pre class="prettyprint"><code>>>> x = d['foo']['bar']['baz']
</code></pre>
<p>This recipe saves you <em>lot</em> of typing!</p>
<p>For simplicity and readability this particular version show a read only lookup class.</p>
Fallout 3 "terminal hacking" minigame cracker (Python)
2008-12-20T11:18:35-08:00Bill Sharerhttp://code.activestate.com/recipes/users/4168512/http://code.activestate.com/recipes/576590-fallout-3-terminal-hacking-minigame-cracker/
<p style="color: grey">
Python
recipe 576590
by <a href="/recipes/users/4168512/">Bill Sharer</a>
(<a href="/recipes/tags/dictionaries/">dictionaries</a>, <a href="/recipes/tags/fallout_3_minigame/">fallout_3_minigame</a>, <a href="/recipes/tags/lists/">lists</a>, <a href="/recipes/tags/sets/">sets</a>, <a href="/recipes/tags/text/">text</a>).
</p>
<p>crackerhacker.py is a script I wrote as a Python learning exercise to help
solve Fallout 3's "terminal hacking" minigame. Many of you may already be
aware of this annoying mind challenge after playing the popular waste of
time from Bethesda Softworks on your favorite pc or console.</p>
<p>more details in the script</p>