Popular recipes tagged "meta:loc=151"http://code.activestate.com/recipes/tags/meta:loc=151/2016-11-24T23:57:35-08:00ActiveState Code RecipesProcess Delimiter-Separated Values data with Python (Python)
2016-11-24T23:57:35-08:00Vasudev Ramhttp://code.activestate.com/recipes/users/4173351/http://code.activestate.com/recipes/580722-process-delimiter-separated-values-data-with-pytho/
<p style="color: grey">
Python
recipe 580722
by <a href="/recipes/users/4173351/">Vasudev Ram</a>
(<a href="/recipes/tags/command/">command</a>, <a href="/recipes/tags/commandline/">commandline</a>, <a href="/recipes/tags/data/">data</a>, <a href="/recipes/tags/dsv/">dsv</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/utilities/">utilities</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>This recipe shows how to read and process delimiter-separated values (DSV) data with a Python command-line program. It provides two ways of specifying the delimiter character, by an ASCII character or an ASCII code, which makes it more flexible than allowing only a character. It allows the DSV data to be specified as one or more filenames on the command line, or given via the standard input of the program.</p>
State Machine Framework (AI) (Python)
2013-09-12T19:50:06-07:00Matt Joneshttp://code.activestate.com/recipes/users/4182764/http://code.activestate.com/recipes/578656-state-machine-framework-ai/
<p style="color: grey">
Python
recipe 578656
by <a href="/recipes/users/4182764/">Matt Jones</a>
(<a href="/recipes/tags/artificial_intelligence/">artificial_intelligence</a>, <a href="/recipes/tags/state_machine/">state_machine</a>).
</p>
<p>A simple state machine framework that could be used for AI or long processing operations. A simple example is provided as well.</p>
<p>Python 3.2 required</p>
Human Population Simulator (Python)
2012-07-13T14:37:26-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578208-human-population-simulator/
<p style="color: grey">
Python
recipe 578208
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/archive/">archive</a>, <a href="/recipes/tags/human/">human</a>, <a href="/recipes/tags/old/">old</a>, <a href="/recipes/tags/populate/">populate</a>, <a href="/recipes/tags/simulation/">simulation</a>).
Revision 2.
</p>
<p>After wondering about how populations can increase in size, a simulator was written with a very simplistic model for total human growth. This is the result of an old experiment and served its purpose well at the time. This is committed for archival to be run under Python 2.5 or later versions.</p>
Twitter incremental backup in YAML format - by HTML get and parse (Python)
2011-09-24T18:09:00-07:00Robert Lujohttp://code.activestate.com/recipes/users/4044016/http://code.activestate.com/recipes/577877-twitter-incremental-backup-in-yaml-format-by-html-/
<p style="color: grey">
Python
recipe 577877
by <a href="/recipes/users/4044016/">Robert Lujo</a>
(<a href="/recipes/tags/backup/">backup</a>, <a href="/recipes/tags/twitter/">twitter</a>, <a href="/recipes/tags/yaml/">yaml</a>).
</p>
<p>Yet another script for backing up Twitter posts (statuses). More information can be found <a href="http://robert-lujo.com/post/10603896621/twitter-backup">here</a>.</p>
<p>The script is based on <a href="http://code.activestate.com/recipes/576594/" rel="nofollow">http://code.activestate.com/recipes/576594/</a>,
<a href="http://movingtofreedom.org/2009/03/18/python-script-for-backing-up-twitter-statuses/." rel="nofollow">http://movingtofreedom.org/2009/03/18/python-script-for-backing-up-twitter-statuses/.</a></p>
csc prototype to arduino board with python API. part II (Python)
2010-12-26T12:20:48-08:00cheeng shu chinhttp://code.activestate.com/recipes/users/163970/http://code.activestate.com/recipes/577521-csc-prototype-to-arduino-board-with-python-api-par/
<p style="color: grey">
Python
recipe 577521
by <a href="/recipes/users/163970/">cheeng shu chin</a>
(<a href="/recipes/tags/api/">api</a>, <a href="/recipes/tags/arduino/">arduino</a>, <a href="/recipes/tags/c/">c</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/serial/">serial</a>).
Revision 2.
</p>
<p>This is the Python API for my arduino uno board.
this is base on what i posted in <a href="http://code.activestate.com/recipes/577520-csc-prototype-to-arduino-board-with-python-api-par/?in=user-163970">Part I</a> ..
I didn't spend time to comments it...
I'll do it once free soon.
Please study it and extend it and share among open source members especially in python... :)</p>
<p>The file name is "cscarduino.py"</p>
<p>if you facing "Pyserial Invalid Handle" issue in your 64bit windows 7 server, Please refer to this:</p>
<ol>
<li><a href="http://permalink.gmane.org/gmane.comp.python.tutor/67030">link1</a></li>
<li><a href="http://www.mail-archive.com/tutor@python.org/msg46974.html">link2</a></li>
</ol>
Subprocess with async I/O pipes class (Python)
2009-05-17T02:02:04-07:00Mike Kazantsevhttp://code.activestate.com/recipes/users/4170279/http://code.activestate.com/recipes/576759-subprocess-with-async-io-pipes-class/
<p style="color: grey">
Python
recipe 576759
by <a href="/recipes/users/4170279/">Mike Kazantsev</a>
(<a href="/recipes/tags/asynchronous/">asynchronous</a>, <a href="/recipes/tags/ipc/">ipc</a>, <a href="/recipes/tags/non_blocking_i_o/">non_blocking_i_o</a>, <a href="/recipes/tags/pipe/">pipe</a>, <a href="/recipes/tags/subprocess/">subprocess</a>).
Revision 2.
</p>
<p>Just stumbled upon the need to move data chunks between subprocesses in a non-linear way with some logic in-between, so tee(1) and fifo(7)'s weren't too good option.
Inspired by 440554, but rewritten from scratch to remove unnecessary delays due to sleep(3) calls and suboptimal try/sleep-based polling.</p>
Pure Python implementation of PEP 380 (yield from) (Python)
2009-04-25T09:03:42-07:00profjimhttp://code.activestate.com/recipes/users/4169991/http://code.activestate.com/recipes/576727-pure-python-implementation-of-pep-380-yield-from/
<p style="color: grey">
Python
recipe 576727
by <a href="/recipes/users/4169991/">profjim</a>
(<a href="/recipes/tags/decorator/">decorator</a>, <a href="/recipes/tags/generators/">generators</a>).
Revision 7.
</p>
<p>Decorator-based implementation of PEP 380 (yield from). This is the simple version (no special handling of nested "yield _from"s).</p>
Odbc connection on win32 (Python)
2004-09-07T06:08:35-07:00Michele Petrazzohttp://code.activestate.com/recipes/users/2024452/http://code.activestate.com/recipes/303667-odbc-connection-on-win32/
<p style="color: grey">
Python
recipe 303667
by <a href="/recipes/users/2024452/">Michele Petrazzo</a>
(<a href="/recipes/tags/sysadmin/">sysadmin</a>).
</p>
<p>This class implement the features of retrieve dsn and tables list on win32. win32all not include this features.</p>
A Python script to test download mirrors (Python)
2004-05-19T21:28:55-07:00Tim Lesherhttp://code.activestate.com/recipes/users/161138/http://code.activestate.com/recipes/284631-a-python-script-to-test-download-mirrors/
<p style="color: grey">
Python
recipe 284631
by <a href="/recipes/users/161138/">Tim Lesher</a>
(<a href="/recipes/tags/web/">web</a>).
Revision 2.
</p>
<p>Bandwidth testing is easy with Python's built-in web access, HTML parsing, and threading modules.</p>
<p>When Fedora Core 2 was released, I wanted to find which download mirror would be fastest when I tried downloading the CD images. It only took about an hour to whip up this mirror bandwidth tester.</p>
<p>This script demonstrates web download, HTML parsing, and some interesting threading issues.</p>