Popular recipes by Hamish Lawson http://code.activestate.com/recipes/users/98049/2002-01-28T18:23:19-08:00ActiveState Code RecipesTesting if a variable is defined (Python) 2001-06-06T11:03:36-07:00Hamish Lawsonhttp://code.activestate.com/recipes/users/98049/http://code.activestate.com/recipes/59892-testing-if-a-variable-is-defined/ <p style="color: grey"> Python recipe 59892 by <a href="/recipes/users/98049/">Hamish Lawson</a> (<a href="/recipes/tags/algorithms/">algorithms</a>). Revision 2. </p> <p>You want to take different courses of action based on whether a variable is defined or not.</p> Converting between ASCII numbers and characters (Python) 2001-06-10T15:39:16-07:00Hamish Lawsonhttp://code.activestate.com/recipes/users/98049/http://code.activestate.com/recipes/65117-converting-between-ascii-numbers-and-characters/ <p style="color: grey"> Python recipe 65117 by <a href="/recipes/users/98049/">Hamish Lawson</a> (<a href="/recipes/tags/text/">text</a>). </p> <p>You want to get the ASCII number of a character, or you want to get the character given by an ASCII number.</p> Replacing a portion of a string (Python) 2001-06-21T09:35:10-07:00Hamish Lawsonhttp://code.activestate.com/recipes/users/98049/http://code.activestate.com/recipes/59890-replacing-a-portion-of-a-string/ <p style="color: grey"> Python recipe 59890 by <a href="/recipes/users/98049/">Hamish Lawson</a> (<a href="/recipes/tags/text/">text</a>). Revision 3. </p> <p>You want to replace that portion of a string at a given position.</p> Sending binary data to stdout under Windows (Python) 2002-01-28T18:23:19-08:00Hamish Lawsonhttp://code.activestate.com/recipes/users/98049/http://code.activestate.com/recipes/65443-sending-binary-data-to-stdout-under-windows/ <p style="color: grey"> Python recipe 65443 by <a href="/recipes/users/98049/">Hamish Lawson</a> (<a href="/recipes/tags/files/">files</a>). Revision 5. </p> <p>You want to send binary data, such as for an image, to stdout under Windows.</p> Processing a string one character at a time (Python) 2001-06-10T15:44:26-07:00Hamish Lawsonhttp://code.activestate.com/recipes/users/98049/http://code.activestate.com/recipes/65118-processing-a-string-one-character-at-a-time/ <p style="color: grey"> Python recipe 65118 by <a href="/recipes/users/98049/">Hamish Lawson</a> (<a href="/recipes/tags/shortcuts/">shortcuts</a>). </p> <p>You want to process a string one character at a time.</p> Swapping values without using a temporary variable (Python) 2001-06-09T00:45:38-07:00Hamish Lawsonhttp://code.activestate.com/recipes/users/98049/http://code.activestate.com/recipes/65112-swapping-values-without-using-a-temporary-variable/ <p style="color: grey"> Python recipe 65112 by <a href="/recipes/users/98049/">Hamish Lawson</a> (<a href="/recipes/tags/shortcuts/">shortcuts</a>). Revision 2. </p> <p>You want to swap the values of some variables, but don't want to use a temporary variable.</p>