Top-rated recipes tagged "in"http://code.activestate.com/recipes/tags/in/top/2013-08-13T21:08:45-07:00ActiveState Code RecipesPachebel Cannon in C (Python)
2013-08-13T21:08:45-07:00Bhttp://code.activestate.com/recipes/users/4187518/http://code.activestate.com/recipes/578640-pachebel-cannon-in-c/
<p style="color: grey">
Python
recipe 578640
by <a href="/recipes/users/4187518/">B</a>
(<a href="/recipes/tags/c/">c</a>, <a href="/recipes/tags/cannon/">cannon</a>, <a href="/recipes/tags/in/">in</a>, <a href="/recipes/tags/music/">music</a>, <a href="/recipes/tags/pachebel/">pachebel</a>).
</p>
<p>only works in windows</p>
Bash completed man and info pages generation (Python)
2011-08-24T03:14:13-07:00Josh Dhttp://code.activestate.com/recipes/users/4179060/http://code.activestate.com/recipes/577854-bash-completed-man-and-info-pages-generation/
<p style="color: grey">
Python
recipe 577854
by <a href="/recipes/users/4179060/">Josh D</a>
(<a href="/recipes/tags/a/">a</a>, <a href="/recipes/tags/all/">all</a>, <a href="/recipes/tags/and/">and</a>, <a href="/recipes/tags/bash/">bash</a>, <a href="/recipes/tags/be/">be</a>, <a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/completed/">completed</a>, <a href="/recipes/tags/consume/">consume</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/first/">first</a>, <a href="/recipes/tags/generation/">generation</a>, <a href="/recipes/tags/get/">get</a>, <a href="/recipes/tags/in/">in</a>, <a href="/recipes/tags/info/">info</a>, <a href="/recipes/tags/line/">line</a>, <a href="/recipes/tags/man/">man</a>, <a href="/recipes/tags/modify/">modify</a>, <a href="/recipes/tags/must/">must</a>, <a href="/recipes/tags/only/">only</a>, <a href="/recipes/tags/pages/">pages</a>, <a href="/recipes/tags/possibilties/">possibilties</a>, <a href="/recipes/tags/possiblities/">possiblities</a>, <a href="/recipes/tags/py/">py</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/run/">run</a>, <a href="/recipes/tags/script/">script</a>, <a href="/recipes/tags/so/">so</a>, <a href="/recipes/tags/tab/">tab</a>, <a href="/recipes/tags/terminal/">terminal</a>, <a href="/recipes/tags/the/">the</a>, <a href="/recipes/tags/this/">this</a>, <a href="/recipes/tags/to/">to</a>).
Revision 6.
</p>
<p>The script it self is very self explaining - the task is simple.
*NIX only unless with cygwin perhaps?</p>
<p>To start this open a terminal and strike the "Tab" key to get all possibilities (strike y, and strike the space key alot). Select all then Copy and save in "comms.txt"
Modify the file so ONLY the possiblities consume a line; no prompts or extra newlines.
(first line must be a command, the last line must be a command)</p>
<p>Save the file ("~/Documents/bashing/comms.txt" is my path) then run this script in "~/Documents/bashing/".</p>
<p>This generates two (2) files: "bash_help_man.sh", "bash_help_info.sh".</p>
<p>Then it runs these files: "bash bash_help_man.sh", "bash bash_help_info.sh".</p>
<p>This produces 2 files for every command (every line) in "comms.txt".
All manpages are wrote in "mans/", all infopages are wrote in "infos/"</p>
<p>There is now alot of files to read and organize; lets separate these by size.
Directories are under1kb, under2kb, etc.</p>
<p>Once complete do as you wish the files less than 128 kb;
these files are COPIED into there new respective home, I repeat COPIED.</p>
<p>The files 128 kb and higher ARE NOT copied to anywhere!</p>
edit dictionary values (possibly restrained) with Tkinter (Python)
2011-03-15T21:37:54-07:00s_h_a_i_ohttp://code.activestate.com/recipes/users/4177334/http://code.activestate.com/recipes/577611-edit-dictionary-values-possibly-restrained-with-tk/
<p style="color: grey">
Python
recipe 577611
by <a href="/recipes/users/4177334/">s_h_a_i_o</a>
(<a href="/recipes/tags/edit/">edit</a>, <a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/in/">in</a>, <a href="/recipes/tags/options/">options</a>).
</p>
<p>The behaviour of applications sometimes depends on various parameters that can be chosen by the user through some GUI. Quite often, these parameters need take value in a predefined set. Parameters include for instance:</p>
<ul>
<li>The number of replications for a simulator.</li>
<li>Dates of beginning/end of sample for time series access/plot.</li>
<li>Log writing</li>
</ul>
<p>This recipe assumes that</p>
<ul>
<li>Such parameters are stored in a dictionary. Values in the dictionnary are used as initial values for the parameters.</li>
<li>Values are "singleton", i.e non iterable (although they may be strings).</li>
<li>When a value is a list instance, its content represent the set of possible values
The recipe offers a simple way to edit the values in a Tkinter Frame, by adding proper widget to it (constrained value are menubutton while unconstrained values are edit widgets).</li>
</ul>
<p>This is done by the function apply(frame,dict,position), which adds to the Tkinter frame the necessary widgets to edit the dictionary dict. Widgets are placed using grid (hence the frame needs use grid() too) and span on two columns. topleft position (x,y) in grid is specified using position= (x,y,0,0)</p>
The Poem ( in Python) (Python)
2008-08-08T10:39:50-07:00Marcello(Harry) Bontempo Salgueirohttp://code.activestate.com/recipes/users/4166255/http://code.activestate.com/recipes/576413-the-poem-in-python/
<p style="color: grey">
Python
recipe 576413
by <a href="/recipes/users/4166255/">Marcello(Harry) Bontempo Salgueiro</a>
(<a href="/recipes/tags/in/">in</a>, <a href="/recipes/tags/poem/">poem</a>, <a href="/recipes/tags/the/">the</a>).
</p>
<p>This is my first poem writing in python.
Why i do that?
I do because i saw some perl poems and not so much in python, just it! =)
Python developers let's go express your art, and domain of langague Python...!!!!
ihulllllllllllllllll!!!
see ya!</p>
<p>marcello.</p>