Popular recipes tagged "meta:loc=99"http://code.activestate.com/recipes/tags/meta:loc=99/2017-04-07T11:51:26-07:00ActiveState Code RecipesTkinter Link or Hyperlink Button (Python)
2017-04-07T11:51:26-07:00Miguel Martínez Lópezhttp://code.activestate.com/recipes/users/4189907/http://code.activestate.com/recipes/580774-tkinter-link-or-hyperlink-button/
<p style="color: grey">
Python
recipe 580774
by <a href="/recipes/users/4189907/">Miguel Martínez López</a>
(<a href="/recipes/tags/button/">button</a>, <a href="/recipes/tags/hyperlink/">hyperlink</a>, <a href="/recipes/tags/link/">link</a>, <a href="/recipes/tags/tkinter/">tkinter</a>, <a href="/recipes/tags/webbrowser/">webbrowser</a>).
Revision 6.
</p>
<p>If a background is not provided, the widget gets the background color from its container. The link button has two states: normal and visited. When the link is clicked, the state change to visited. When the link is clicked the action command is called. By default the text of the link has an underline. There is several options for customization.</p>
<p>I also added this megawidget to my "Metro UI Tkinter" recipe:</p>
<p><a href="https://code.activestate.com/recipes/580729-metro-ui-tkinter" rel="nofollow">https://code.activestate.com/recipes/580729-metro-ui-tkinter</a></p>
File comparison utility in Python (Python)
2016-03-26T18:31:11-07:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580631-file-comparison-utility-in-python/
<p style="color: grey">
Python
recipe 580631
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/comparison/">comparison</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/files/">files</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/unix/">unix</a>, <a href="/recipes/tags/utilities/">utilities</a>).
</p>
<p>This is a recipe to compare any two files via a Python command-line program.
It is like a basic version of the cmp command of Unix or the fc.exe (file compare) command of Windows.</p>
Pasting python data into a spread sheet (Python)
2014-09-16T15:49:07-07:00Tomas Nordinhttp://code.activestate.com/recipes/users/4189558/http://code.activestate.com/recipes/578933-pasting-python-data-into-a-spread-sheet/
<p style="color: grey">
Python
recipe 578933
by <a href="/recipes/users/4189558/">Tomas Nordin</a>
(<a href="/recipes/tags/clipboard/">clipboard</a>, <a href="/recipes/tags/spreadsheet/">spreadsheet</a>).
Revision 3.
</p>
<p>A smooth way to paste data you are working with in python into a spreadsheet. Put into the system clipboard, select a cell and do ctrl-v (at least with ms office and libre-office).</p>
sav2mdb (Python)
2014-02-17T20:53:56-08:00Albert-Jan Roskamhttp://code.activestate.com/recipes/users/4177640/http://code.activestate.com/recipes/578826-sav2mdb/
<p style="color: grey">
Python
recipe 578826
by <a href="/recipes/users/4177640/">Albert-Jan Roskam</a>
(<a href="/recipes/tags/access/">access</a>, <a href="/recipes/tags/spss/">spss</a>).
Revision 2.
</p>
<p>sav2mdb.py: convert SPSS system files (codepage) to Microsoft Access files</p>
dynamic mathjax demo page (HTML)
2015-02-12T13:10:17-08:00yotahttp://code.activestate.com/recipes/users/4184815/http://code.activestate.com/recipes/578679-dynamic-mathjax-demo-page/
<p style="color: grey">
HTML
recipe 578679
by <a href="/recipes/users/4184815/">yota</a>
(<a href="/recipes/tags/latex/">latex</a>, <a href="/recipes/tags/math/">math</a>, <a href="/recipes/tags/mathjax/">mathjax</a>).
Revision 7.
</p>
<p>Html web page to preview latex equations rendered by mathjax. <a href="http://jsfiddle.net/r82p49xx/5/">demo here</a></p>
<p>Equations are updated when shift, space or enter keys are pressed, or when the Textarea lose focus.</p>
<p>In the first block you can try inline-style math, in the second one, display-style math.</p>
Black Jack (Python)
2013-06-29T20:12:54-07:00superducktoxichttp://code.activestate.com/recipes/users/4187037/http://code.activestate.com/recipes/578586-black-jack/
<p style="color: grey">
Python
recipe 578586
by <a href="/recipes/users/4187037/">superducktoxic</a>
.
</p>
<p>Play black jack against the computer</p>
Eight queen problem (Javascript) (JavaScript)
2013-03-20T19:03:44-07:00Thomas Lehmannhttp://code.activestate.com/recipes/users/4174477/http://code.activestate.com/recipes/578497-eight-queen-problem-javascript/
<p style="color: grey">
JavaScript
recipe 578497
by <a href="/recipes/users/4174477/">Thomas Lehmann</a>
(<a href="/recipes/tags/algorithm/">algorithm</a>, <a href="/recipes/tags/queen/">queen</a>, <a href="/recipes/tags/queens/">queens</a>).
</p>
<ul>
<li>Adding this for my old <a href="http://code.activestate.com/recipes/577438/">recipe 577438</a> (in Python).</li>
<li>Use node.js or HTML as execution (see comments in "log" function)</li>
</ul>
download the Activestate cook book recipe (Python)
2013-01-29T16:24:22-08:00lwz7512http://code.activestate.com/recipes/users/4185066/http://code.activestate.com/recipes/578439-download-the-activestate-cook-book-recipe/
<p style="color: grey">
Python
recipe 578439
by <a href="/recipes/users/4185066/">lwz7512</a>
.
</p>
<p>Small effort to store the python recipes to our local</p>
<p>similar effort by other people:
543267-i-will-download-all-of-the-recipes-from-the-python
535162-i-download-all-the-python-cookbook-recipes</p>
download the Activestate cook book recipe (Python)
2012-07-04T12:14:22-07:00Sudeep AMhttp://code.activestate.com/recipes/users/4182702/http://code.activestate.com/recipes/578193-download-the-activestate-cook-book-recipe/
<p style="color: grey">
Python
recipe 578193
by <a href="/recipes/users/4182702/">Sudeep AM</a>
.
Revision 2.
</p>
<p>Small effort to store the python recipes to our local</p>
<p>similar effort by other people:
543267-i-will-download-all-of-the-recipes-from-the-python
535162-i-download-all-the-python-cookbook-recipes</p>
Morse Code (Python)
2012-01-12T23:45:12-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578012-morse-code/
<p style="color: grey">
Python
recipe 578012
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/demonstration/">demonstration</a>, <a href="/recipes/tags/example/">example</a>, <a href="/recipes/tags/experiment/">experiment</a>, <a href="/recipes/tags/morse/">morse</a>, <a href="/recipes/tags/morse_code/">morse_code</a>, <a href="/recipes/tags/program/">program</a>, <a href="/recipes/tags/sound/">sound</a>).
Revision 3.
</p>
<p>After seeing another recipe recently that helps people with Morse Code, I was inspired to clean up the following code just a bit to make it worthy for the rest of the world. After being executed, it waits for lines of text to be entered, compiles each one in turn into timing codes, and plays them back with a simple execution</p>
A Simple Class for Transforming Python Source Files (Python)
2011-07-12T22:04:44-07:00Eric Snowhttp://code.activestate.com/recipes/users/4177816/http://code.activestate.com/recipes/577788-a-simple-class-for-transforming-python-source-file/
<p style="color: grey">
Python
recipe 577788
by <a href="/recipes/users/4177816/">Eric Snow</a>
(<a href="/recipes/tags/backport/">backport</a>, <a href="/recipes/tags/transform/">transform</a>).
Revision 3.
</p>
<p>Subclass with some replacements and you are ready to go. If the replacements aren't good enough simply override the transform() method.</p>
Decorator to expose local variables of a function after execution (Python)
2010-07-07T22:01:23-07:00Pietro Berkeshttp://code.activestate.com/recipes/users/4174299/http://code.activestate.com/recipes/577283-decorator-to-expose-local-variables-of-a-function-/
<p style="color: grey">
Python
recipe 577283
by <a href="/recipes/users/4174299/">Pietro Berkes</a>
(<a href="/recipes/tags/decorator/">decorator</a>, <a href="/recipes/tags/function/">function</a>, <a href="/recipes/tags/inner/">inner</a>, <a href="/recipes/tags/local/">local</a>, <a href="/recipes/tags/scope/">scope</a>, <a href="/recipes/tags/variables/">variables</a>).
Revision 2.
</p>
<p>Decorator to expose the local variables defined in the inner scope of a function. At the exit of the decorated function (regular exit or exceptions), the local dictionary is copied to a read-only property, <code>locals</code>.</p>
<p>The main implementation is based on injecting bytecode into the original function, and requires the lightweight module <code>byteplay</code> (available <a href="http://code.google.com/p/byteplay/">here</a>). See below for an alternative implementation that only uses the standard library.</p>
Better quote module for bash shells (Python)
2010-12-03T09:16:45-08:00Kevin L. Sitzehttp://code.activestate.com/recipes/users/4173535/http://code.activestate.com/recipes/577483-better-quote-module-for-bash-shells/
<p style="color: grey">
Python
recipe 577483
by <a href="/recipes/users/4173535/">Kevin L. Sitze</a>
(<a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/escape/">escape</a>, <a href="/recipes/tags/logging/">logging</a>, <a href="/recipes/tags/quote/">quote</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/shell/">shell</a>).
</p>
<p>This Python module quotes a Python string so that it will be treated as a single argument to commands ran via os.system() (assuming bash is the underlying shell). In other words, this module makes arbitrary strings "command line safe" (for bash command lines anyway, YMMV if you're using Windows or one of the (less fine) posix shells).</p>
McCarthy's amb operator in Python (Python)
2010-08-23T22:41:53-07:00Paddy McCarthyhttp://code.activestate.com/recipes/users/398009/http://code.activestate.com/recipes/577368-mccarthys-amb-operator-in-python/
<p style="color: grey">
Python
recipe 577368
by <a href="/recipes/users/398009/">Paddy McCarthy</a>
(<a href="/recipes/tags/declarative/">declarative</a>, <a href="/recipes/tags/style/">style</a>).
</p>
<p>From reading about amb it seems that it allows for a declaritive style of programming where the one amb "operator" can
* Set the ranges of variables
* Set a constraint function
* And iterate over all solutions </p>
<p>(See <a href="http://paddy3118.blogspot.com/2010/08/mccarthys-amb-operator-in-python.html" rel="nofollow">http://paddy3118.blogspot.com/2010/08/mccarthys-amb-operator-in-python.html</a> for a more descriptive intro).</p>
elegant numbers (Python)
2010-03-01T09:18:11-08:00mahthirhttp://code.activestate.com/recipes/users/4173194/http://code.activestate.com/recipes/577076-elegant-numbers/
<p style="color: grey">
Python
recipe 577076
by <a href="/recipes/users/4173194/">mahthir</a>
.
</p>
<p>elegant numbers are those numbers whose prime factors are 2,3,5,7 or 11.</p>
Heise mp3 downloader (Python)
2009-01-17T11:51:39-08:00d.schlabinghttp://code.activestate.com/recipes/users/4168903/http://code.activestate.com/recipes/576618-heise-mp3-downloader/
<p style="color: grey">
Python
recipe 576618
by <a href="/recipes/users/4168903/">d.schlabing</a>
(<a href="/recipes/tags/oop/">oop</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/threads/">threads</a>).
</p>
<p>This little script presents new heise-news-articles individually by title and asks if it should download the corresponding mp3-file.</p>
Merge join for N iterators (Python)
2008-10-29T03:50:37-07:00Joel Nothmanhttp://code.activestate.com/recipes/users/4165330/http://code.activestate.com/recipes/576371-merge-join-for-n-iterators/
<p style="color: grey">
Python
recipe 576371
by <a href="/recipes/users/4165330/">Joel Nothman</a>
(<a href="/recipes/tags/algorithms/">algorithms</a>).
Revision 2.
</p>
<p>Performs a merge join on any number of iterators with sorted, unique keys. I.e., iterate through the data in parallel, outputting successive keys and all corresponding values from each iterator, or None if not available.</p>
Dependencies graph of a script or module (Python)
2007-11-24T01:27:39-08:00Oliver Schoenbornhttp://code.activestate.com/recipes/users/1458241/http://code.activestate.com/recipes/535136-dependencies-graph-of-a-script-or-module/
<p style="color: grey">
Python
recipe 535136
by <a href="/recipes/users/1458241/">Oliver Schoenborn</a>
.
</p>
<p>This is a recipe to generate a diagram of dependencies of a script. It uses Python's modulefinder to get the dependencies, the two scripts available from <a href="http://www.tarind.com/depgraph.html" rel="nofollow">http://www.tarind.com/depgraph.html</a> to generate a dot file, and graphviz to convert the dot file to PNG. It also filters out a lot of noise and facilitates configurability.</p>
Bass class for PDO abstraction (PHP)
2010-03-28T01:16:30-07:00Jeff Griffithshttp://code.activestate.com/recipes/users/835605/http://code.activestate.com/recipes/522993-bass-class-for-pdo-abstraction/
<p style="color: grey">
PHP
recipe 522993
by <a href="/recipes/users/835605/">Jeff Griffiths</a>
(<a href="/recipes/tags/database/">database</a>).
Revision 2.
</p>
<p>This is a simple base class that extends PDO and provides some useful helper functions such as _getRows and _getAsRow()</p>
Listenable Sets (Python)
2007-05-29T17:36:24-07:00Raymond Hettingerhttp://code.activestate.com/recipes/users/178123/http://code.activestate.com/recipes/520593-listenable-sets/
<p style="color: grey">
Python
recipe 520593
by <a href="/recipes/users/178123/">Raymond Hettinger</a>
(<a href="/recipes/tags/database/">database</a>).
Revision 2.
</p>
<p>Monitor sets for changes using the Observer design pattern.</p>