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
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!
"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:
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.
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
Carl Banks is right
--
http://mail.python.org/mailman/listinfo/python-list
"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
aha
we want to do it with python
don't use ant
--
http://mail.python.org/mailman/listinfo/python-list
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
"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
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.
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
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
13 matches
Mail list logo