Scripts Index
Related Topics
Popular Trends
Trending Topics
Python Libraries and Modules  

Using a Dictionary in place of 'sw

download download home home   report broken
important script information
company name:
code.activestate.com
license: Free
minimum requirements: Python
functional limitations:
Using a Dictionary in place of 'sw description


This script shows a clean way of implementing a 'switch' statement in Python via a dictionary container. The dictionary is made up of known 'named states' that are tested in sequence for their current 'state'.



Relates:
Statement - Switch - Dictionary - Switch Statement - Dictionary Use - Dictionary Container
Similar scripts
IPv4 address set type (Popularity: ) : IPv4 address set type script initializes an ip4range class.The constructor accepts an unlimited number of arguments that may either be tuples in the form (start,stop), integers, longs or strings, where start and stop in a tuple may also be of ...
Gather detailed system information on Mac OS X (Popularity: ) : This script uses the system_profiler application to retrieve detailed information about a Mac OS X system.There are two useful ways to use it: the first is to ask for a complete Python datastructure containing information about the system (see OSXSystemProfiler.all()) and ...
msoffice2ps Python Module (Popularity: ) : This Python module can be used for conversion of Microsoft Office documents to Postscript via an installed postscript printer driver. This module uses Microsoft Office and the installed postscript printer driver for the export. You can use this module to ...
Gather detailed system information on Ma (Popularity: ) : This script uses the system_profiler application to retrieve detailed information about a Mac OS X system.There are two useful ways to use it: the first is to ask for a complete Python datastructure containing information about the system (see OSXSystemProfiler.all()) ...
PyHtmlTable (Popularity: ) : Allows on-the-fly creation of HTML tables in Python. Similar to Table.pm or Table.php.
Numeric base converter (Popularity: ) : This is a traditional base converter with the twist that it accepts any strings as the digits for the input and output bases. Besides all the normal base-converts, you can now create compact versions of huge numbers by converting them ...
Memento design pattern in python (Popularity: ) : Memento design pattern in python script allows you to cache instances based on what arguments are passed to them.
cgi_buffer (Popularity: ) : A group of libraries that can be used to improve performance in your CGI scripts.
Generator for sequence operations (Popularity: ) : Permutations and combinations are often required in algorithms that do a complete search of the solution space. They are typically rather large so it's best not to compute them entirely but better to lazily generate them.This script uses Python generators ...
Null Object Design Pattern (Popularity: ) : This script is a sample implementation of the 'Null Object' design pattern. Roughly, the goal with Null objects is to provide an 'intelligent' replacement for the often used primitive data type None in Python or Null (or Null pointers) in ...
User reviews

Write a review:
1 2 3 4 5 6 7 8 9 10
1=poor 10=excellent
Write review*
Your name*
Email*
  (Comments are moderated, and will not appear on this site until the editor has approved them)
 
Similar Software
A Sitch in Time (Popularity: ) : A Sitch in Time 2 is an interesting adventure game for free. The goal for you is to travel into the past to stop the villains from crushing KimOCOs spirit. In the game, use four arrow keys to control Kim. ...
A Point in Time (Popularity: ) : A Point in Time is a Timesheet User Interface specifically designed for the User. Not the Administrator. Not the Accountants. Not the Payroll Department. The user. Users will actually look forward to using 'A Point in Time', and keeping their ...
PatchTool 4.0.0 b312 (Popularity: ) : PatchTool is designed to visualize, manipulate, re-order, average, compare (with statistics), convert, and export color lists in a color-managed environment. You can export a list as an image, in plain text format, or in a CGATS compatible file format; you ...
GStreamer FFmpeg Plug-in (Popularity: ) : GStreamer FFmpeg plug-in contains one plugin with a set of elements that use the FFmpeg library code. It contains most popular decoders as well as very fast colorspace conversion elements.

GStreamer is a library that allows the construction of graphs of ...

Collins French English Dictionary Mac (Popularity: ) : Collins French English Dictionary for Mac is a collegiate-level lexicon and verb book for students and travelers, offering thousands of entries including slang, technical terms, and idiomatic expressions. We provide a rich thesaurus of synonyms and antonyms, full verb conjugations ...
Collins German English Dictionary Mac (Popularity: ) : Collins German English Dictionary for Mac is a collegiate-level lexicon and verb book for students and travelers, offering thousands of entries including slang, technical terms, and idiomatic expressions. We provide a rich thesaurus of synonyms and antonyms, full verb conjugations ...
Collins Italian English Dictionary Mac (Popularity: ) : Collins Italian English Dictionary for Mac is a collegiate-level lexicon and verb book for students and travelers, offering thousands of entries including slang, technical terms, and idiomatic expressions. We provide a rich thesaurus of synonyms and antonyms, full verb conjugations ...
Collins Spanish English Dictionary Mac (Popularity: ) : Collins Spanish English Dictionary for Mac is a collegiate-level lexicon and verb book for students and travelers, offering thousands of entries including slang, technical terms, and idiomatic expressions. We provide a rich thesaurus of synonyms and antonyms, full verb conjugations ...
Ultralingua French Dictionary (Popularity: ) : Ultralingua French Dictionary & Thesaurus is a collegiate-level lexicon and verb book for students and travelers, offering thousands of entries including slang, technical terms, and idiomatic expressions. We provide a rich thesaurus of synonyms and antonyms, full verb conjugations in ...
Ultralingua Italian-English Dictionary (Popularity: ) : Ultralingua Italian-English Dictionary is a collegiate-level lexicon and verb book for students and travelers, offering thousands of entries including slang, technical terms, and idiomatic expressions. We provide a rich thesaurus of synonyms and antonyms, full verb conjugations in all tenses, ...
ad


Rate me
supported os
All
stats
downloads 10
version 1.0
size in Kb
popularity   
958/376920
user rating 5/10
New Scripts
Popular Scripts
Latest Reviews