Top-rated recipes tagged "features"http://code.activestate.com/recipes/tags/features/top/2017-02-23T22:38:50-08:00ActiveState Code RecipesSimulate C's switch statement (Python)
2016-12-11T16:28:50-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580730-simulate-cs-switch-statement/
<p style="color: grey">
Python
recipe 580730
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/c/">c</a>, <a href="/recipes/tags/features/">features</a>, <a href="/recipes/tags/language/">language</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/switch/">switch</a>).
</p>
<p>This recipe shows a Python construct that can behave somewhat like C's switch statement. It is not a perfect one-to-one simulation. But it does have some of the features of the C switch. One feature not supported is the fall-through feature in C's switch.</p>
ListPopulatedFeatures&Tables.py (Python)
2013-09-10T13:39:47-07:00kmoneyhttp://code.activestate.com/recipes/users/4187770/http://code.activestate.com/recipes/578654-listpopulatedfeaturestablespy/
<p style="color: grey">
Python
recipe 578654
by <a href="/recipes/users/4187770/">kmoney</a>
(<a href="/recipes/tags/arcgis/">arcgis</a>, <a href="/recipes/tags/catalog/">catalog</a>, <a href="/recipes/tags/features/">features</a>, <a href="/recipes/tags/geodatabase/">geodatabase</a>, <a href="/recipes/tags/tables/">tables</a>).
</p>
<p>Quick and dirty Pytyon 2.7.5 script that prints a catalog of non-empty features and tables within a file-gdb or folder of mdb's using ArcGIS 10.1's arcpy library.</p>
Simulating an unless (reverse if) statement in Python (Python)
2017-02-23T22:38:50-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580758-simulating-an-unless-reverse-if-statement-in-pytho/
<p style="color: grey">
Python
recipe 580758
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/features/">features</a>, <a href="/recipes/tags/if/">if</a>, <a href="/recipes/tags/perl/">perl</a>, <a href="/recipes/tags/programming/">programming</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/trick/">trick</a>).
</p>
<p>This recipe shows how to simulate an unless statement (a sort of reverse if, like Perl has), in Python. It is just for fun and as an experiment, not meant for real use, because the effect of unless can easily be got by negating the sense of the condition in an if statement.</p>
<p>More details and output here:</p>
<p><a href="https://jugad2.blogspot.in/2017/02/perl-like-unless-reverse-if-feature-in.html" rel="nofollow">https://jugad2.blogspot.in/2017/02/perl-like-unless-reverse-if-feature-in.html</a></p>