Re: Script to make Windows XP-readable ZIP file

2006-05-19 Thread Larry Bates
pac wrote: > I'm preparing to distribute a Windows XP Python program and some > ancillary files, > and I wanted to put everything in a .ZIP archive. It proved to be > inordinately > difficult and I thought I would post my solution here. Is there a > better one? > > Suppose you have a set of fil

Re: Script to make Windows XP-readable ZIP file

2006-05-19 Thread Grant Edwards
On 2006-05-19, softwindow <[EMAIL PROTECTED]> wrote: > Carl Banks is right That would be valuable information if we know what he was right about. -- Grant Edwards grante Yow! Bo Derek ruined at my life!

Re: Script to make Windows XP-readable ZIP file

2006-05-18 Thread John Bokma
"softwindow" <[EMAIL PROTECTED]> wrote: > Carl Banks is right Did he write to check out: http://groups.google.com/support/bin/answer.py?answer=14213 ? Why didn't you do so? -- John MexIT: http://johnbokma.com/mexit/ personal page:

Re: Script to make Windows XP-readable ZIP file

2006-05-18 Thread softwindow
import os import zipfile z = zipfile.ZipFile(r"c:\text.zip",mode="w",compression=zipfile.ZIP_DEFLATED) cwd = os.getcwd() try: for dirpath,dirs,files in os.walk(cwd): for file in files: z_path = os.path.join(dirpath,file) start = cwd.rfind(os.sep)+1 z.

Re: Script to make Windows XP-readable ZIP file

2006-05-18 Thread softwindow
aha now it's right like this: import os import zipfile z = zipfile.ZipFile(r"c:\text.zip",mode="w",compression=zipfile.ZIP_DEFLATED) cwd = os.getcwd() try: for dirpath,dirs,files in os.walk(cwd): for file in files: z_path = os.path.join(dirpath,file) start = cwd

Re: Script to make Windows XP-readable ZIP file

2006-05-18 Thread softwindow
Carl Banks is right -- http://mail.python.org/mailman/listinfo/python-list

Re: Script to make Windows XP-readable ZIP file

2006-05-18 Thread John Bokma
"softwindow" <[EMAIL PROTECTED]> wrote: > aha > we want to do it with python > don't use ant :-D I want to do a lot with Perl, but sometimes it's better to use the right tool for the job. And I think that Ant is better at for what I use it compared to a home brew tool I could make. Be careful

Re: Script to make Windows XP-readable ZIP file

2006-05-18 Thread softwindow
aha we want to do it with python don't use ant -- http://mail.python.org/mailman/listinfo/python-list

Re: Script to make Windows XP-readable ZIP file

2006-05-18 Thread softwindow
my code can work, like below: import os import zipfile z = zipfile.ZipFile(r"c:\text.zip",mode="w",compression=zipfile.ZIP_DEFLATED) cwd = os.getcwd() try: for dirpath,dirs,files in os.walk(cwd): for file in files: z_path = os.path.join(dirpath,file) z.write(z_p

Re: Script to make Windows XP-readable ZIP file

2006-05-18 Thread John Bokma
"pac" <[EMAIL PROTECTED]> wrote: > I'm preparing to distribute a Windows XP Python program and some > ancillary files, > and I wanted to put everything in a .ZIP archive. It proved to be > inordinately > difficult and I thought I would post my solution here. Is there a > better one? heresy may

Re: Script to make Windows XP-readable ZIP file

2006-05-18 Thread Carl Banks
pac wrote: > Suppose you have a set of files in a directory c:\a\b and some > additional > files in c:\a\b\subdir. Using a Python script, you would > like to make a Windows-readable archive (.zip) that preserves this > directory structure, and where the root directory of the archive is > c:\a\b.

Re: Script to make Windows XP-readable ZIP file

2006-05-18 Thread softwindow
i am in win2000 "z.write(a_path,a_path)" may change to "z.write(a_path)" but the dirpath is not in zipfile who can tell me? -- http://mail.python.org/mailman/listinfo/python-list

Script to make Windows XP-readable ZIP file

2006-05-18 Thread pac
I'm preparing to distribute a Windows XP Python program and some ancillary files, and I wanted to put everything in a .ZIP archive. It proved to be inordinately difficult and I thought I would post my solution here. Is there a better one? Suppose you have a set of files in a directory c:\a\b an