Popular recipes tagged "key"http://code.activestate.com/recipes/tags/key/2011-12-06T08:46:33-08:00ActiveState Code RecipesGet single keypress (Python)
2011-12-06T08:46:33-08:00Steven D'Apranohttp://code.activestate.com/recipes/users/4172944/http://code.activestate.com/recipes/577977-get-single-keypress/
<p style="color: grey">
Python
recipe 577977
by <a href="/recipes/users/4172944/">Steven D'Aprano</a>
(<a href="/recipes/tags/getch/">getch</a>, <a href="/recipes/tags/key/">key</a>).
</p>
<p>Here's a platform-independent module that exposes a single function, getch, which reads stdin for a single character. It uses msvcrt.getch on Windows, and should work on any platform that supports the tty and termios modules (e.g. Linux).</p>
<p>This has been tested on Python 2.4, 2.5 and 2.6 on Linux.</p>
Conjunction select using foreign keys (Text)
2011-06-11T02:43:22-07:00Kaushik Ghosehttp://code.activestate.com/recipes/users/4166965/http://code.activestate.com/recipes/577747-conjunction-select-using-foreign-keys/
<p style="color: grey">
Text
recipe 577747
by <a href="/recipes/users/4166965/">Kaushik Ghose</a>
(<a href="/recipes/tags/conjunction/">conjunction</a>, <a href="/recipes/tags/foreign/">foreign</a>, <a href="/recipes/tags/key/">key</a>, <a href="/recipes/tags/select/">select</a>, <a href="/recipes/tags/sql/">sql</a>).
</p>
<p>Say we have a table (notes) containing rows we want to select. Each note has one or more keywords (stored in a table of the same name). We want to select notes that have a conjunction of keywords (AND). notes and keywords are linked through a foreign key table notes_keywords. The following SQL statement allows us to do this</p>
Monkey-patch execnet with more ssh settings, port, identity file, non-interactive (Python)
2011-01-15T16:35:00-08:00Dima Tisnekhttp://code.activestate.com/recipes/users/4068698/http://code.activestate.com/recipes/577545-monkey-patch-execnet-with-more-ssh-settings-port-i/
<p style="color: grey">
Python
recipe 577545
by <a href="/recipes/users/4068698/">Dima Tisnek</a>
(<a href="/recipes/tags/batchmode/">batchmode</a>, <a href="/recipes/tags/execnet/">execnet</a>, <a href="/recipes/tags/identity/">identity</a>, <a href="/recipes/tags/key/">key</a>, <a href="/recipes/tags/network/">network</a>, <a href="/recipes/tags/noninteractive/">noninteractive</a>, <a href="/recipes/tags/port/">port</a>, <a href="/recipes/tags/public/">public</a>, <a href="/recipes/tags/python/">python</a>, <a href="/recipes/tags/ssh/">ssh</a>).
</p>
<p>execnet ( <a href="http://codespeak.net/execnet/" rel="nofollow">http://codespeak.net/execnet/</a> ) is pretty cool, but its ssh support needs a few tweaks, here they are.</p>
<p>This snipped is a monkey patch, not a diff, import it and you can use execnet.makeportgateway instead of makegateway.</p>
<p>Adapt to your needs even more!</p>
Changing shortcut on a usb key V2 (Python)
2008-08-22T13:34:57-07:00bussiere bussierehttp://code.activestate.com/recipes/users/4050557/http://code.activestate.com/recipes/576437-changing-shortcut-on-a-usb-key-v2/
<p style="color: grey">
Python
recipe 576437
by <a href="/recipes/users/4050557/">bussiere bussiere</a>
(<a href="/recipes/tags/key/">key</a>, <a href="/recipes/tags/raccourcis/">raccourcis</a>, <a href="/recipes/tags/shortcut/">shortcut</a>, <a href="/recipes/tags/usb/">usb</a>, <a href="/recipes/tags/windows/">windows</a>).
Revision 2.
</p>
<p>i've made some shortcut on my usb key for launchy and i had always to change them if on one pc the usb drive was i: on an other it was k: it was such a pain each time.
Now it change all the shortcut automatically.</p>