Including binary files in a .py file; advice needed

Grant Edwards grante at
Fri Jun 6 16:50:05 CEST 2003

In article <3EDEB0A6.202 at>, Gary Duncan wrote:

> Here's what I want to do; distribute a .py file (a GUI app) with
> an embedded (binary) .GIF file (a photo of me at 1 yo ;) rather than
> distribute both separately. For convenience, mainly.

Here's how I did it:


LogoImage = PhotoImage(data=LogoString)

> If in a Unix shell script, I'd uuencode the .GIF and include the 
> printable-ASCII file in it as a 'here' file. When executed the script
> would 'cat' it out to e.g. a /tmp file from the main body of the script, 
> then uudecode the /tmp file to revert to the original .GIF file.

Sounds complicated with temp file and all.

Grant Edwards                   grante             Yow!  A GRAM?? A BRAM... A
                                  at               GROOM... A BROOM... Oh,
                                 Yeh!! Wash the ROOM!!

More information about the Python-list mailing list