Including binary files in a .py file; advice needed
grante at visi.com
Fri Jun 6 16:50:05 CEST 2003
In article <3EDEB0A6.202 at netspace.net.au>, 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:
LogoString = """R0lGODdhtQByAPcAAAAAAA4DBA4NCxsGBxwaFSkJCyonIDYMDjgqIzg0KkQOEkQZGUY3LkZB
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,
visi.com Yeh!! Wash the ROOM!!
More information about the Python-list