Popular recipes tagged "meta:license=gpl"http://code.activestate.com/recipes/tags/meta:license=gpl/2015-10-16T12:11:36-07:00ActiveState Code Recipesdefdict (Python) 2015-10-15T15:45:16-07:00userhttp://code.activestate.com/recipes/users/4187240/http://code.activestate.com/recipes/579113-defdict/ <p style="color: grey"> Python recipe 579113 by <a href="/recipes/users/4187240/">user</a> (<a href="/recipes/tags/abstract_base_class/">abstract_base_class</a>, <a href="/recipes/tags/datastructures/">datastructures</a>, <a href="/recipes/tags/dictionary/">dictionary</a>). </p> <p>default dictionary with collision function to handle key collisions.</p> Add function to Python's __builtin__ module through C API - makefile (Text) 2015-10-16T12:11:36-07:00airweenhttp://code.activestate.com/recipes/users/4192997/http://code.activestate.com/recipes/579111-add-function-to-pythons-__builtin__-module-through/ <p style="color: grey"> Text recipe 579111 by <a href="/recipes/users/4192997/">airween</a> (<a href="/recipes/tags/api/">api</a>, <a href="/recipes/tags/c/">c</a>, <a href="/recipes/tags/makefile/">makefile</a>, <a href="/recipes/tags/python/">python</a>). </p> <p>Makefile for add function to __builtin__ module through C API.</p> <p>C source is here:</p> <p><a href="https://code.activestate.com/recipes/579110-add-function-to-__builtin__-module-through-c-api/" rel="nofollow">https://code.activestate.com/recipes/579110-add-function-to-__builtin__-module-through-c-api/</a></p> <p>Python script is here:</p> <p><a href="https://code.activestate.com/recipes/579112-add-function-to-__builtin__-module-through-c-api-c/" rel="nofollow">https://code.activestate.com/recipes/579112-add-function-to-__builtin__-module-through-c-api-c/</a></p> Add function to Python's __builtin__ module through C API - Python source (Python) 2015-10-16T12:10:58-07:00airweenhttp://code.activestate.com/recipes/users/4192997/http://code.activestate.com/recipes/579112-add-function-to-pythons-__builtin__-module-through/ <p style="color: grey"> Python recipe 579112 by <a href="/recipes/users/4192997/">airween</a> . Revision 2. </p> <p>Add function to __builtin__ module through C API - Python source</p> <p>References:</p> <p><a href="https://code.activestate.com/recipes/579110-add-function-to-__builtin__-module-through-c-api/" rel="nofollow">https://code.activestate.com/recipes/579110-add-function-to-__builtin__-module-through-c-api/</a></p> <p><a href="https://code.activestate.com/recipes/579111-add-function-to-__builtin__-module-through-c-api-c/" rel="nofollow">https://code.activestate.com/recipes/579111-add-function-to-__builtin__-module-through-c-api-c/</a></p> <p>Save this source as you want in same directory, where C source and compiled binary exists.</p> <p>After the "make", you can use it: $ ./pytestbin this_source</p> <p>without ".py" extension.</p> Fixed Lengh List (Python) 2014-01-24T15:27:25-08:00Hirohttp://code.activestate.com/recipes/users/4184239/http://code.activestate.com/recipes/578813-fixed-lengh-list/ <p style="color: grey"> Python recipe 578813 by <a href="/recipes/users/4184239/">Hiro</a> (<a href="/recipes/tags/length/">length</a>, <a href="/recipes/tags/list/">list</a>). Revision 2. </p> <p>In some applications, it's advantageous to be able to define a fixed length list.</p> <p>The class provides all features as python internal type: list</p> <p>The main focus of <strong>fixed length</strong> list is only keep certain number of items. "overflow" items will be discarded.</p> QGIS startup script: Change display of coordinates (Python) 2015-01-11T10:53:38-08:00redoutehttp://code.activestate.com/recipes/users/4188210/http://code.activestate.com/recipes/578692-qgis-startup-script-change-display-of-coordinates/ <p style="color: grey"> Python recipe 578692 by <a href="/recipes/users/4188210/">redoute</a> (<a href="/recipes/tags/coordinates/">coordinates</a>, <a href="/recipes/tags/gis/">gis</a>, <a href="/recipes/tags/qgis/">qgis</a>, <a href="/recipes/tags/startup/">startup</a>). </p> <p>This script for QGIS version 2 replaces the default statusbar coordinate display with a configurable widget. Save the script as .qgis2/python/startup.py. Click the statusbar widget left of the coordinates, initially labelled 'EPSG:4326', to select the demanded CRS. Delete startup.py to deinstall.</p> A Simple Clock, Well Maybe Not That Simple... (Bash) 2013-07-17T17:40:18-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578610-a-simple-clock-well-maybe-not-that-simple/ <p style="color: grey"> Bash recipe 578610 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/clock/">clock</a>, <a href="/recipes/tags/digital/">digital</a>, <a href="/recipes/tags/digits/">digits</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/large/">large</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/readout/">readout</a>, <a href="/recipes/tags/terminal/">terminal</a>). </p> <p>Hi all...</p> <p>Do you remember this little snippet?</p> <p><a href="http://code.activestate.com/recipes/578079-pure-fun-for-text-mode-python/?in=user-4177147" rel="nofollow">http://code.activestate.com/recipes/578079-pure-fun-for-text-mode-python/?in=user-4177147</a></p> <p>Well it was voted down, but who cares? I surely don't! So to those that voted this FUN piece of Python coding down, you are now about to see what the aim was.</p> <p>However although I have subsequently done what I said I would, that is, to create large digits as an _at_a_glance_ digital readout for a project in Python I have decided not to upload it. However I have decided to let this one go as a bash/shell script instead.</p> <p>It is a nothing but a simple clock, well, maybe not that simple; but as I am into shell stuff at the moment I thought I would share this with you.</p> <p>The terminal does have its colours changed and the cursor disabled for the session but I expect you big guns to be able to return back to normal in a jiffy.</p> <p>I am an amateur coder and if that is easy for me then you pros should have no problems.</p> <p>This code is not like most of my other stuff as is NOT Public Domain...</p> <p>It is only a DEMO to see what an at a glance display would look like in a terminal.</p> <p>Move away to a distance and see which of the two time readings you can still read... ;o)</p> <p>It is for a Macbook Pro 13" OSX 10.7.5 and uses bash imode. It will probably work on most Linux machines too but I haven't tested it...</p> <p>This is purely a DEMO only and any other special effects, (e.g. flashing colon every second), alram, etc, I have already experimented with and is easy enough to do...</p> <p>My intention is to use this as a kids level text mode digital voltmeter I am doing.</p> <p>Enjoy...</p> <p>Bazza...</p> A Simple Clock, Well Maybe Not That Simple... (Python) 2013-08-09T18:15:09-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578633-a-simple-clock-well-maybe-not-that-simple/ <p style="color: grey"> Python recipe 578633 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/amiga/">amiga</a>, <a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/big/">big</a>, <a href="/recipes/tags/clock/">clock</a>, <a href="/recipes/tags/digits/">digits</a>, <a href="/recipes/tags/e_uae/">e_uae</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/time/">time</a>, <a href="/recipes/tags/winuae/">winuae</a>). </p> <p>BIG_TIME.py</p> <p>Remember this?</p> <p><a href="http://code.activestate.com/recipes/578610-a-simple-clock-well-maybe-not-that-simple/" rel="nofollow">http://code.activestate.com/recipes/578610-a-simple-clock-well-maybe-not-that-simple/</a></p> <p>And this?</p> <p><a href="http://code.activestate.com/recipes/578079-pure-fun-for-text-mode-python/?in=user-4177147" rel="nofollow">http://code.activestate.com/recipes/578079-pure-fun-for-text-mode-python/?in=user-4177147</a></p> <p>Well the Python version of the top URL has been uploaded to AMINET on 01-08-2013...</p> <p>Now the big gun that complained about my fun Python upload and voted it down can see that this was a serious attempt ae viewing "Hello World!" in extra large xharacters.</p> <p>This is the result in Python...</p> <p>It is ONLY uploaded to AMINET and that is where it will stay.</p> <p>If you want it then use the pointer inside code section.</p> <p>Remember to change the BIG_TIME.py.txt file on AMINET to BIG_TIME.py...</p> <p>Designed around a Macbook Pro OSX 10.7.5 for the Classic AMIGA platforms and works on Debian 6.0.x and PCLiuxOS 2009 using Python versions 1.4.0 to 3.3.2 inclusive...</p> <p>Although the description in the AMINET readme below is for an AMIGA environment it does not take a genius to adapt it to the other platforms...</p> <p>Boy was this difficult to get working in a single Python script...</p> <p>ENJOY...</p> <p>This is the AMINET readme file:-</p> <p>Short: A Big Digital Clock Python Script. Author: <a href="mailto:wisecracker@tesco.net">wisecracker@tesco.net</a> (Barry Walker) Uploader: <a href="mailto:wisecracker@tesco.net">wisecracker@tesco.net</a> (Barry Walker) Type: dev/src Version: 1.00.00 Architecture: generic; m68k-amigaos</p> <p>Distribution: Public Domain, Emailware.</p> <p>============================================================================</p> <h5 id="architectures-classic-amigas-e-uae-and-winuae">Architectures: Classic AMIGAs, E-UAE and WinUAE.</h5> <p>MINIMUM Requirements Are:-</p> <hr /> <pre class="prettyprint"><code> 68EC020 CPU and 2MB RAM total, example, a standard A1200(HD). WinUAE Version 1.5.3 minimum. Standard OS3.0x install or better. Python Version 1.4.0 or higher. (Also, OSX 10.7.5, Debian Linux 6.0.x and PCLinuxOS 2009.) </code></pre> <hr /> <h5 id="history">History.</h5> <p>01-08-2013. Version 1.00.00:- Original upload to AMINET...</p> <p>This is dedicated entirely to the AMIGA community and AMINET and will not be uploaded elsewhere.</p> <hr /> <p>To install just download the "BIG_TIME.py.txt" file and rename it to "BIG_TIME.py" without the quotes. Drag this file into your AMIGA PYTHON: volume and...</p> <p>From a minimum of Python Version 1.4.0 prompt:-</p> <pre class="prettyprint"><code>&gt;&gt;&gt; exec(open("PYTHON:BIG_TIME.py").read())&lt;CR&gt; </code></pre> <p>And away you go...</p> <p>This code is/was designed to work in all versions of Python from 1.4.0 to 3.3.2 on at least the platforms shown in the Architectures: section.</p> <p>It was developed entirely on a Macbook Pro OSX 10.7.5 and finalised using MEmacs for the AMIGA.</p> <hr /> <p>This is just a simple DEMO to show how to generate large digits in Python and put them to use as an _AT_A_GLANCE_ digital clock.</p> <p>It starts up by generating all of the characters available for the DEMO for five seconds then goes into the clock proper.</p> <p>As this code is multi platform AND multi Python version then it is issued as GPL2...</p> <p>Enjoy finding simple solutions to often very difficult problems...</p> <hr /> <pre class="prettyprint"><code> IMPORTANT:- ----------- The Legal Stuff:- ----------------- This Python script is issued under the GPL2 licence conditions. The author is not responsible for any damage to, or loss of, or failure of equipment or data caused in any way by the use of this script. There is NO warranty with the use of this software release and YOU USE IT AT YOUR OWN RISK. </code></pre> <hr /> <pre class="prettyprint"><code>Testing Evaluation:- -------------------- All WinUAE, E-UAE and Classic AMIGA test conditions were/are running standard OS3.0x/OS3.1x and using standard ~topaz 8~ fonts throughout. I have no idea what strange configuration setups will create so refer to the ~The Legal Stuff~ above. </code></pre> <hr /> <p>Contact:-</p> <hr /> <p>Mr Barry Walker, G0LCU.</p> <p>Email:- <a href="mailto:wisecracker@tesco.net">wisecracker@tesco.net</a></p> <p>Author of the ~TestGear?~ projects in the ~docs/hard~ drawer of AMINET.</p> <hr /> <p>A very useful HardWare related site, (C) Anthony Hoffman, for modifications, schematics, repairs and the like is:-</p> <pre class="prettyprint"><code> <a href="http://amiga.serveftp.net/">http://amiga.serveftp.net/</a> </code></pre> <p>============================================================================</p> Decimal Number To Byte(s) And String To Byte(s) Converter. (Python) 2012-01-24T21:11:47-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578025-decimal-number-to-bytes-and-string-to-bytes-conver/ <p style="color: grey"> Python recipe 578025 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/bytes/">bytes</a>, <a href="/recipes/tags/converter/">converter</a>, <a href="/recipes/tags/decimal/">decimal</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/string/">string</a>, <a href="/recipes/tags/windows/">windows</a>). </p> <p>A function to convert decimal integer numbers, (from 0 to 255), into byte(s) format. Another function calling the above function to convert ASCII strings into byte(s) format.</p> <p>Python 3.1.3 (r313:86834, Nov 28 2010, 10:01:07) [GCC 4.4.5] on linux2 Type "help", "copyright", "credits" or "license" for more information.</p> <pre class="prettyprint"><code>&gt;&gt;&gt; exec(open('/home/G0LCU/Desktop/Code/d2b.py').read()) &gt;&gt;&gt; a=78 &gt;&gt;&gt; type(a) &lt;class 'int'&gt; &gt;&gt;&gt; b=d2b(a) &gt;&gt;&gt; print(b) b'N' &gt;&gt;&gt; type(b) &lt;class 'bytes'&gt; &gt;&gt;&gt; text="\x00(C)2012, B.Walker, G0LCU.\xFF" &gt;&gt;&gt; len(text) 27 &gt;&gt;&gt; type(text) &lt;class 'str'&gt; &gt;&gt;&gt; newtext=t2b(text) &gt;&gt;&gt; len(newtext) 27 &gt;&gt;&gt; print(newtext) b'\x00(C)2012, B.Walker, G0LCU.\xff' &gt;&gt;&gt; type(newtext) &lt;class 'bytes'&gt; </code></pre> <p>It requires NOTHING special at all to work and can be run like above or imported from the correct "Lib" drawer/folder/directorfy as:-</p> <pre class="prettyprint"><code>&gt;&gt;&gt; import d2b </code></pre> <p>And when imported called as:-</p> <pre class="prettyprint"><code>&gt;&gt;&gt; d2b.d2b(some_number, optional_some_other_mumber)&lt;RETURN/ENTER&gt; </code></pre> <p>OR</p> <pre class="prettyprint"><code>&gt;&gt;&gt; d2b.t2b(some_ASCII_string)&lt;RETURN/ENTER&gt; </code></pre> <p>Read the code for much more information...</p> <p>Issued under the GPL2 licence.</p> <p>Enjoy finding simple solutions to often very difficult problems.</p> <p>Bazza, G0LCU.</p> For MacBook_Pro-Heads Only. Simple LF Audio Oscilloscope Using Standard Text Mode Python. (Python) 2012-10-07T14:15:55-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578282-for-macbook_pro-heads-only-simple-lf-audio-oscillo/ <p style="color: grey"> Python recipe 578282 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/anim/">anim</a>, <a href="/recipes/tags/apple/">apple</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/display/">display</a>, <a href="/recipes/tags/macbook_pro/">macbook_pro</a>, <a href="/recipes/tags/oscilloscope/">oscilloscope</a>, <a href="/recipes/tags/pyaudio/">pyaudio</a>, <a href="/recipes/tags/scope/">scope</a>, <a href="/recipes/tags/sound/">sound</a>). </p> <p>For MacBook_Pro-Heads Only. Simple LF Audio Oscilloscope Using Standard Text Mode Python.</p> <p>SimpleScope_OSX.py</p> <p>Do you remember this upload from myself on 26-06-2011...</p> <p><a href="http://code.activestate.com/recipes/577771-simple-lf-audio-oscilloscope-using-standard-text-m/?in=user-4177147" rel="nofollow">http://code.activestate.com/recipes/577771-simple-lf-audio-oscilloscope-using-standard-text-m/?in=user-4177147</a></p> <p>Well here is an August 2012 vintage MacBook Pro 13 inch version of it for OSX 10.7.5...</p> <p>This is proof of concept code for a kids level project I am doing for a MacBook Pro, 13 inch, OSX 10.7.5. A DEMO to show how to display a waveform using standard text mode Python. "pyaudio" must be installed for this to work. Levels are set using the standard audio mixers, (System Preferences -> Sound).</p> <p>Just whistle a signal of say 300Hz to 3KHz, (normal voice spectrum), using say, the internal mic, and watch a waveform appear inside the X-Y graticule.</p> <p>Read the code for more information.</p> <p>$VER: SimpleScope_OSX.py_Version_0.00.10_(C)2012_B.Walker_G0LCU.</p> <p>This code is GPL2, but, the hardware information is Public Domain.</p> <p>(I am looking into including Windows and Linux variants too using pyaudio to access the sound system.)</p> <p>Enjoy finding simple solutions to often very difficult problems.</p> <p>Bazza, G0LCU...</p> Create replica of the existing directory structure with only specified extension files. (Python) 2012-11-16T08:30:31-08:00Achal Rastogihttp://code.activestate.com/recipes/users/4183889/http://code.activestate.com/recipes/578303-create-replica-of-the-existing-directory-structure/ <p style="color: grey"> Python recipe 578303 by <a href="/recipes/users/4183889/">Achal Rastogi</a> (<a href="/recipes/tags/bioinformatics/">bioinformatics</a>, <a href="/recipes/tags/biology/">biology</a>, <a href="/recipes/tags/directory/">directory</a>, <a href="/recipes/tags/fileextensions/">fileextensions</a>, <a href="/recipes/tags/replica/">replica</a>). Revision 2. </p> <p>The program creates a replica of existing directory structure with specified extension files only. The program maintains the directory-sub-directory architecture while executing. User has to provide two arguments, First the path of existing directory,whose replica has to be created and Second, the path of directory, where the replica has to be created. This program is developed to fetch files with ".pl" (perl) extension, while maintaining the directory-sub-directory architecture. User can modify it, with his/her interested file extension, like ".txt", ".doc", etc.</p> A Crude Baby Alarm For Standard Text Mode Python And Linux. (Python) 2012-08-02T18:05:29-07:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578232-a-crude-baby-alarm-for-standard-text-mode-python-a/ <p style="color: grey"> Python recipe 578232 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/alarm/">alarm</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/baby_alarm/">baby_alarm</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/sound/">sound</a>). </p> <p>This is a simple audio monitor that records about 1/2 second of sound then immediately plays it back in a continuous loop.</p> <p>If you are testing with a laptop's, (etc), internal microphone be aware that acoustic feedback might occur...</p> <p>This could be a use for your now aging netbook... ;o)</p> <p>Bazza, G0LCU...</p> Amplitude Modulation - Tremolo, Was:- An Audio/Sound Snippet For Linux... ;o) (Python) 2012-01-21T14:18:28-08:00Barry Walkerhttp://code.activestate.com/recipes/users/4177147/http://code.activestate.com/recipes/578013-amplitude-modulation-tremolo-was-an-audiosound-sni/ <p style="color: grey"> Python recipe 578013 by <a href="/recipes/users/4177147/">Barry Walker</a> (<a href="/recipes/tags/amplitude/">amplitude</a>, <a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/demo/">demo</a>, <a href="/recipes/tags/linux/">linux</a>, <a href="/recipes/tags/mod/">mod</a>, <a href="/recipes/tags/modulation/">modulation</a>, <a href="/recipes/tags/sound/">sound</a>, <a href="/recipes/tags/tremolo/">tremolo</a>). Revision 2. </p> <p>This IS for the big guns as well as the amatuer...</p> <p>I am always being told that too many comments inside any code is bad and that professional coders are clever enough to work out what a program does without comments...</p> <p>So here goes! This snippet of code hits /dev/dsp in Linux and has no comments as to what it does. Make sure that /dev/dsp is available in your Linux install - if not then install oss.compat from your repository.</p> <p>It needs Python 2.6 minimum, but may well work on a much earlier version</p> <p>Don't run the code first but have a go at working out what it does and see if you are correct... ;o)</p> <p>You can email me if you think you are/were correct:- <a href="http://wisecracker_at_tesco.net" rel="nofollow">wisecracker_at_tesco.net</a></p> <p>Bear in mind I don't think this has ever been done before by hitting the /dev/dsp __directly__.</p> <p>NOTE:- NO imports are required at all!!!</p> <p>It runs for about 7 seconds before exiting...</p> <p>Another BIG PLUS for Linux.</p> <p>(I have a feeling poeple on here might like this, possibly even vote it up. ;)</p> <p>Answer now at the bottom of this page...</p> <p>Enjoy...</p> <p>Bazza, G0LCU...</p> Using vlc.py to record an mp3 and save a cue file (Python) 2011-07-25T15:55:38-07:00Anton Vredegoorhttp://code.activestate.com/recipes/users/2667360/http://code.activestate.com/recipes/577802-using-vlcpy-to-record-an-mp3-and-save-a-cue-file/ <p style="color: grey"> Python recipe 577802 by <a href="/recipes/users/2667360/">Anton Vredegoor</a> (<a href="/recipes/tags/audio/">audio</a>, <a href="/recipes/tags/recording/">recording</a>). Revision 2. </p> <p>This is an example of how to use vlc.py . It records an mp3 file from an online audio stream, using the track announcements to write an accompanying cue file. </p> Extract air quality data of Santigo , Chile on csv file (Python) 2011-06-30T13:39:29-07:00jrovegnohttp://code.activestate.com/recipes/users/4170207/http://code.activestate.com/recipes/577773-extract-air-quality-data-of-santigo-chile-on-csv-f/ <p style="color: grey"> Python recipe 577773 by <a href="/recipes/users/4170207/">jrovegno</a> (<a href="/recipes/tags/aire/">aire</a>, <a href="/recipes/tags/calidad/">calidad</a>, <a href="/recipes/tags/chile/">chile</a>, <a href="/recipes/tags/data_mining/">data_mining</a>, <a href="/recipes/tags/santiago/">santiago</a>). </p> <p>Extract air quality data of Santigo , Chile on csv file</p> Python Gmail script (smtp) (Python) 2011-06-08T20:15:01-07:00jrovegnohttp://code.activestate.com/recipes/users/4170207/http://code.activestate.com/recipes/577690-python-gmail-script-smtp/ <p style="color: grey"> Python recipe 577690 by <a href="/recipes/users/4170207/">jrovegno</a> (<a href="/recipes/tags/gmail/">gmail</a>, <a href="/recipes/tags/smtp/">smtp</a>). Revision 4. </p> <p>Referencias: <a href="http://ideaschile.wordpress.com/2011/05/12/python-gmail-script-smtp/">Python Gmail script (smtp)</a></p> Extract data from feedjit (Python) 2011-05-03T19:50:27-07:00jrovegnohttp://code.activestate.com/recipes/users/4170207/http://code.activestate.com/recipes/577683-extract-data-from-feedjit/ <p style="color: grey"> Python recipe 577683 by <a href="/recipes/users/4170207/">jrovegno</a> (<a href="/recipes/tags/data/">data</a>, <a href="/recipes/tags/feedjit/">feedjit</a>). Revision 2. </p> <p>Script to extract data from my live traffic feed from feedjit</p> Un arreglo zig-zag es un arreglo cuadrado de los primeros N2 enteros (Python) 2011-01-11T23:56:55-08:00jrovegnohttp://code.activestate.com/recipes/users/4170207/http://code.activestate.com/recipes/577536-un-arreglo-zig-zag-es-un-arreglo-cuadrado-de-los-p/ <p style="color: grey"> Python recipe 577536 by <a href="/recipes/users/4170207/">jrovegno</a> (<a href="/recipes/tags/zigzag/">zigzag</a>). Revision 5. </p> <p>Un arreglo zig-zag es un arreglo cuadrado de los primeros N2 enteros, donde los nĂºmeros van ordenados de menor a mayor distribuidos en forma de zig zag a lo largo de las anti diagonales de la matriz (ver la figura).</p> <p>Por ejemplo, si N es 5, el programa debe producir este arreglo:</p> <p>0 1 5 6 14</p> <p>2 4 7 13 15</p> <p>3 8 12 16 21</p> <p>9 11 17 20 22</p> <p>10 18 19 23 24</p> <p><a href="http://www.lnds.net/blog/2011/01/un-test-mas-dificil.html" rel="nofollow">http://www.lnds.net/blog/2011/01/un-test-mas-dificil.html</a></p> Robot Pager (Search engines and others) (Python) 2010-10-10T19:33:20-07:00Carlos del Ojohttp://code.activestate.com/recipes/users/4173977/http://code.activestate.com/recipes/577420-robot-pager-search-engines-and-others/ <p style="color: grey"> Python recipe 577420 by <a href="/recipes/users/4173977/">Carlos del Ojo</a> (<a href="/recipes/tags/automate/">automate</a>, <a href="/recipes/tags/engine/">engine</a>, <a href="/recipes/tags/paging/">paging</a>, <a href="/recipes/tags/robot/">robot</a>, <a href="/recipes/tags/search/">search</a>, <a href="/recipes/tags/websites/">websites</a>). Revision 3. </p> <p>This is a class to make easy the development of robots, to parse results over a website with a paging. For example Google, Yahoo, Bing, or any other page with paging system.</p> <p>PagerEngine is the main class. I've developed three more clases implementing GoogleSearch, YahooSearch and BingSearch as examples.</p> <p>Inheriting from PagerEngine (and having RexExp knowledge) you can easily develop other robots for other websites.</p> Script para descargar videos desde http://www.chilevision.cl/ (Python) 2010-08-23T20:20:15-07:00jrovegnohttp://code.activestate.com/recipes/users/4170207/http://code.activestate.com/recipes/577367-script-para-descargar-videos-desde-httpwwwchilevis/ <p style="color: grey"> Python recipe 577367 by <a href="/recipes/users/4170207/">jrovegno</a> (<a href="/recipes/tags/chv/">chv</a>, <a href="/recipes/tags/download/">download</a>, <a href="/recipes/tags/tv/">tv</a>, <a href="/recipes/tags/video/">video</a>). </p> <p>Requiere: - aria2c - wget Extras: Ofrece Descargar el resto de los videos Uso: # Comillas requeridas, problema parser cvh_video.py "http://www.chilevision.cl/home/index.php?option=com_content&amp;task=view&amp;id=YYYYY&amp;Itemid=XXX"</p> Script para saber calida del aire Santiago de Chile (Python) 2011-06-02T00:55:02-07:00jrovegnohttp://code.activestate.com/recipes/users/4170207/http://code.activestate.com/recipes/577369-script-para-saber-calida-del-aire-santiago-de-chil/ <p style="color: grey"> Python recipe 577369 by <a href="/recipes/users/4170207/">jrovegno</a> (<a href="/recipes/tags/aire/">aire</a>, <a href="/recipes/tags/calidad/">calidad</a>, <a href="/recipes/tags/santiago/">santiago</a>). Revision 4. </p> <p>Script para saber calida del aire Santiago de Chile</p>