Embedding a binary file in a python script

mrstephengross mrstephengross at hotmail.com
Wed Feb 15 12:02:32 EST 2006


Ok, this is a neat idea... The uu module deals with files though, not
strings. Is there a way in python to make a string act like a file
handle?

Example:

my_string = "uu-encoded-stuf......"
my_out_file_handle = ?? # What should this variable look like?
import uu
uu.decode(my_string, my_out_file_handle)
import tarfile
tarfile.open(my_out_file_handle)

Thanks again,
--Steve (mrstephengross at hotmail.com)




More information about the Python-list mailing list