Re: Embedding a binary file in a python script

2006-02-20 Thread Florent Manens
Hi, Le 15-02-2006, mrstephengross <[EMAIL PROTECTED]> a écrit : > I want to find a way to embed a tar file *in* my python script, and > then use the tarfile module to extract it. That is, instead of > distributing two files (extractor.py and archive.tar) I want to be able > to distribute *one* fil

Re: Embedding a binary file in a python script

2006-02-15 Thread mrstephengross
Good point I appreciate all the help, and apologize if I came across badly. I'm definitely willing to put in the work to understand all this, it's just that it's a lot of new modules for me and I'm a bit overwhelmed. Sorry if I seemed impatient... -- http://mail.python.org/mailman/listinfo/py

Re: Embedding a binary file in a python script

2006-02-15 Thread Rene Pijlman
mrstephengross: >Ok, this looks really cool, but can you explain a little more >step-by-step what's going on? What happened to "Hey thanks, I'll look into that" :-( -- René Pijlman -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding a binary file in a python script

2006-02-15 Thread Diez B. Roggisch
mrstephengross wrote: > 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? (c)?StringIO Diez -- http://mail.python.org/mailman/listinfo/python-list

Re: Embedding a binary file in a python script

2006-02-15 Thread mrstephengross
Ok, this looks really cool, but can you explain a little more step-by-step what's going on? In the end, I need to have a single python script that (1) contains the archive and (2) can extract that archive. The example you've given is interesting, but it's not clear to me how to create the actual py

Re: Embedding a binary file in a python script

2006-02-15 Thread mrstephengross
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_h

Re: Embedding a binary file in a python script

2006-02-15 Thread Fredrik Lundh
"mrstephengross" wrote: > I want to find a way to embed a tar file *in* my python script, and > then use the tarfile module to extract it. That is, instead of > distributing two files (extractor.py and archive.tar) I want to be able > to distribute *one* file (extractor-with-embedded-archive.py).

Re: Embedding a binary file in a python script

2006-02-15 Thread Rene Pijlman
mrstephengross: >I want to find a way to embed a tar file *in* my python script, and >then use the tarfile module to extract it. That is, instead of >distributing two files (extractor.py and archive.tar) I want to be able >to distribute *one* file (extractor-with-embedded-archive.py). Is there >a w

Embedding a binary file in a python script

2006-02-15 Thread mrstephengross
I want to find a way to embed a tar file *in* my python script, and then use the tarfile module to extract it. That is, instead of distributing two files (extractor.py and archive.tar) I want to be able to distribute *one* file (extractor-with-embedded-archive.py). Is there a way to do this? Than