Popular recipes by stewart midwinter http://code.activestate.com/recipes/users/970057/2006-04-03T18:15:55-07:00ActiveState Code RecipesObtain encoded string representations of images, for use in your apps (Python) 2006-04-03T18:15:55-07:00stewart midwinterhttp://code.activestate.com/recipes/users/970057/http://code.activestate.com/recipes/476223-obtain-encoded-string-representations-of-images-fo/ <p style="color: grey"> Python recipe 476223 by <a href="/recipes/users/970057/">stewart midwinter</a> (<a href="/recipes/tags/graphics/">graphics</a>). </p> <p>Say you want to generate a default image with my app without having to include an image file with my app. You'll want to encode the binary image data as text, using base64. This image can later be displayed in my app, or a binary image file can be written by decoding the encoded text string using the base64 module. To make this task a little easier for you, I created a small GUI app using Wax. Simply run the app, select the image file you want converted, then copy the encoded text string and paste it into your app (which could be a Wax, wxPython, Qt or even Tkinter app). The last part of the recipe shows you how to decode that text string back to binary data.</p> How to create linked OptionMenus (or other lists) in Tkinter (Python) 2004-02-26T21:55:20-08:00stewart midwinterhttp://code.activestate.com/recipes/users/970057/http://code.activestate.com/recipes/271249-how-to-create-linked-optionmenus-or-other-lists-in/ <p style="color: grey"> Python recipe 271249 by <a href="/recipes/users/970057/">stewart midwinter</a> . </p> <p>This recipe shows how to create linked OptionMenus in Tkinter. That is, how to ensure that when you select an item in the first list, the list contents change in the second list, which changes the contents in the third list. While this code is for Pmw OptionMenus, it should be easily adaptable to other types of picklist or radiobutton widgets.</p>