Popular recipes by Gary Eakins http://code.activestate.com/recipes/users/470921/2013-06-20T20:23:09-07:00ActiveState Code Recipesascii2wide Translate printable non-whitespace ascii characters to wide characters (Python) 2013-06-20T20:23:09-07:00Gary Eakinshttp://code.activestate.com/recipes/users/470921/http://code.activestate.com/recipes/578577-ascii2wide-translate-printable-non-whitespace-asci/ <p style="color: grey"> Python recipe 578577 by <a href="/recipes/users/470921/">Gary Eakins</a> (<a href="/recipes/tags/ascii/">ascii</a>, <a href="/recipes/tags/translate/">translate</a>, <a href="/recipes/tags/wide/">wide</a>). </p> <p>Translates ascii characters to wide characters.</p> Run a function in a separate (forked) process without blocking (Python) 2008-02-28T22:22:18-08:00Gary Eakinshttp://code.activestate.com/recipes/users/470921/http://code.activestate.com/recipes/550801-run-a-function-in-a-separate-forked-process-withou/ <p style="color: grey"> Python recipe 550801 by <a href="/recipes/users/470921/">Gary Eakins</a> (<a href="/recipes/tags/fork/">fork</a>, <a href="/recipes/tags/mmap/">mmap</a>, <a href="/recipes/tags/process/">process</a>). Revision 2. </p> <p>A procedure that runs a function asynchronously in a forked process (Availability: Macintosh, Unix). The return from the specified function is written into an anonymous memory map (mmap: requires +Python 2.5). This can be useful for releasing resources used by the function such as memory, updating a gui or cli widget, or other weirdness.</p> Calling Windows API using ctypes and win32con (Python) 2008-07-25T20:01:50-07:00Gary Eakinshttp://code.activestate.com/recipes/users/470921/http://code.activestate.com/recipes/208699-calling-windows-api-using-ctypes-and-win32con/ <p style="color: grey"> Python recipe 208699 by <a href="/recipes/users/470921/">Gary Eakins</a> (<a href="/recipes/tags/ctypes/">ctypes</a>, <a href="/recipes/tags/windows_api/">windows_api</a>). Revision 4. </p> <p>It is easy to call Windows API dlls using the ctypes module with win32con defining the constant values for message identifiers and parameter flags. The demo code shows a simple but complete application that registers a window class and a Python WndProc callback function, creates the window and pumps messages.</p>