Popular Python recipes tagged "meta:requires=_thread"http://code.activestate.com/recipes/langs/python/tags/meta:requires=_thread/2013-09-02T01:51:53-07:00ActiveState Code RecipesAsyncGetter (Python)
2013-06-01T18:20:15-07:00Nick Farohttp://code.activestate.com/recipes/users/4184363/http://code.activestate.com/recipes/578540-asyncgetter/
<p style="color: grey">
Python
recipe 578540
by <a href="/recipes/users/4184363/">Nick Faro</a>
(<a href="/recipes/tags/asynchronous/">asynchronous</a>, <a href="/recipes/tags/getting/">getting</a>).
</p>
<p>You specify it a 'get' function and it runs a thread and gets it for you. Incredibly simple.</p>
Directory Pruner 4 (Python)
2012-06-06T22:00:00-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578154-directory-pruner-4/
<p style="color: grey">
Python
recipe 578154
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/delete/">delete</a>, <a href="/recipes/tags/directory/">directory</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/utility/">utility</a>).
Revision 2.
</p>
<p>Module providing GUI capability to prune any directory.</p>
<p>The code presented in this module is for the purposes of: (1) ascertaining
the space taken up by a directory, its files, its sub-directories, and its
sub-files; (2) allowing for the removal of the sub-files, sub-directories,
files, and directory found in the first purpose; (3) giving the user a GUI
to accomplish said purposes in a convenient way that is easily accessible.</p>
affinity.py (Python)
2012-06-05T03:12:55-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/578151-affinitypy/
<p style="color: grey">
Python
recipe 578151
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/cpu_usage/">cpu_usage</a>, <a href="/recipes/tags/threadsafe/">threadsafe</a>).
</p>
<p>Allow a simple way to ensure execution is confined to one thread.</p>
<p>This module defines the Affinity data type that runs code on a single thread.
An instance of the class will execute functions only on the thread that made
the object in the first place. The class is useful in a GUI's main loop.</p>
Rudimentary Database Engine (Python)
2013-09-02T01:51:53-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577825-rudimentary-database-engine/
<p style="color: grey">
Python
recipe 577825
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/database/">database</a>, <a href="/recipes/tags/engine/">engine</a>, <a href="/recipes/tags/example/">example</a>, <a href="/recipes/tags/experiment/">experiment</a>).
Revision 2.
</p>
<p>This module was written for self-academic purposes in an attempt to understand databases better. Just as in college where students are required to reinvent "wheels" like linked lists, trees, binary searches, et cetera, developing this program helped me understand some of the things that goes on behind the scenes in a database while also helping to learn what the desired output of each operation should be. The code in this module provides support for running a simple database engine that runs completely in memory and allows usage of various concepts available in a structured query language to get and set data that may be saved to file.</p>
Directory Pruner 2 (Python)
2011-04-05T01:37:14-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577633-directory-pruner-2/
<p style="color: grey">
Python
recipe 577633
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/delete/">delete</a>, <a href="/recipes/tags/directory/">directory</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>This program builds on work done in <a href="http://code.activestate.com/recipes/577632/">recipe 577632</a>, adds new options to the context menu, and experiments with threading the GUI. Directory Pruner 2 appear to work better on Windows 7 while Directory Pruner 1 (the non-threaded version) performs better on Windows XP. Those are the primary platforms on which the two programs have been tested. Please use these applications at your own risk.</p>
<p>If you do not like something about this recipe and want to vote it down, please let everyone what you find fault with, how you would improve it, and an example of the code you would improve.</p>
Directory Pruner 3 (Python)
2011-04-05T23:15:58-07:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577635-directory-pruner-3/
<p style="color: grey">
Python
recipe 577635
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/delete/">delete</a>, <a href="/recipes/tags/directory/">directory</a>, <a href="/recipes/tags/file/">file</a>, <a href="/recipes/tags/gui/">gui</a>, <a href="/recipes/tags/utility/">utility</a>).
</p>
<p>After considering the monolithic design of <a href="http://code.activestate.com/recipes/577633/">recipe 577633</a> and deciding that it should be divided into several smaller modules, Directory Pruner 3 was written to take advantage of better abstraction methodologies. There are a total of twelve files in the project, and all of them except the first are contained within a directory called "Directory Pruner 3" such that they make up a package in Python. Like the other Directory Pruners, please use and configure this program at your own computer's risk.</p>
<p>If you have any comments or wish to vote this recipe down, please provide an explanation as to what you find fault with in this program and also a solution that you would implement to fix the problem.</p>
Bible Verse Quiz - database.py (Python)
2010-02-12T04:22:59-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/577052-bible-verse-quiz-databasepy/
<p style="color: grey">
Python
recipe 577052
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/bible/">bible</a>, <a href="/recipes/tags/quiz/">quiz</a>, <a href="/recipes/tags/verse/">verse</a>, <a href="/recipes/tags/_versematch_/">_versematch_</a>).
Revision 2.
</p>
<p>Serve verses from the Bible in response to SQL queries.</p>
<p>Pulling Bible verses out of a database allows query details to be
abstracted away and powerful Verse objects returned to the caller.</p>
Paratessares Time (Python)
2009-01-27T18:43:51-08:00Stephen Chappellhttp://code.activestate.com/recipes/users/2608421/http://code.activestate.com/recipes/576636-paratessares-time/
<p style="color: grey">
Python
recipe 576636
by <a href="/recipes/users/2608421/">Stephen Chappell</a>
(<a href="/recipes/tags/paratessares/">paratessares</a>, <a href="/recipes/tags/tessaressunago/">tessaressunago</a>, <a href="/recipes/tags/time/">time</a>).
Revision 3.
</p>
<p>This module provides several functions that covert earth seconds into paratessares time. It is used to implement time keeping on a fictional planet and is the standard time system of Tessaressunago. It can be used as an inspiration to other people creating their own units of time or as partitioned timestamps that can be applied to records. There are four different modules listed below: the standard implementation, a unit test, and two examples. To see the Python 2.5 version of this code in action and to test out its functionality, you can go over to the Utility Mill and find Paratessares_Time in the library ( <a href="http://utilitymill.com/utility/Paratessares_Time" rel="nofollow">http://utilitymill.com/utility/Paratessares_Time</a> ).</p>