Monday, September 20, 2004

Having problems putting some source in your blog?

Especially if you can't use any html headers and stuph. Of want to add some form of binary data along with it: use this.. . . .
Stuph it in you python ide and run.
It will result in a file, once called, will create a compressed, base64, blogspot ready of any file you give it.

here'se the source (cut and paste ought to work i guess):

import base64,zlib;f=file("fileToBloggablePython.py",'wb');f.write(zlib.decompress(base64.decodestring("""eNqtUU1LwzAYvg/2H0LKSMJqQRBBRyc4hwiyg8OTSsi6t1ugTUKSMeevN+36MRl4Wg45vHk+30TRJc5wEEWovp4X7+j1ZTZfLOdP9WCmzcHKzdaj1QG9QZlp9KjBlqLjXCbAcCBLo22wEQ5ub+KfQq5i7RIj/LZ+zRHnSpTAeZpizkshFef4fjhA4Ti9sxnksgCUIiv2XCqz85T08wfCjlAP3z6t1JNMl8aCc1QbULSHxsSuCEssiDVl8V3D0zt/rt8MO/GQUmnfYptwf9lNp8SZQvoTV/Zxdf01JolwmZSJOZDOtiJVCRuNmOxbO2Ol8mg6DS8xwhifr3CSpxWH4pHDgRh6TfJkb6UHWu9gDd0Wjqx6sgbng/SGjhxjFSMrtAPKggUaIdrX6ur9Vyo+x5Og9KnIuPEEdeJZfRAbVwjSwvsvaJP8Asg+yOs=""")));f.close()