py2exe/distutils: how to include a tree of files?

Grant Edwards grante at visi.com
Fri Aug 24 21:14:33 EDT 2007


On 2007-08-25, Carl Banks <pavlovevidence at gmail.com> wrote:
> On Aug 24, 5:46 pm, Grant Edwards <gra... at visi.com> wrote:
>> On 2007-08-24, Grant Edwards <gra... at visi.com> wrote:
>>
>> > I'm packaging up a python program and need to include an entire
>> > directory tree in the distribution.
>>
>> I've cobbled together something using package_dir/package_data
>> and  os.path.walk(), but it seems like a bit of a kludge...
>
> "data_files" is documented in the official distutils
> documentation.

It took quite a while, but I eventually found it.  Having the
documentation split up into dozens and dozens of small pages
sure makes it hard to find things. I don't really understand
what the advantage for splitting up documentation into
screen-sized chunks is supposed to be -- all the web browsers
I've ever seen can scroll.  One page per module or chapter
sure would make it easier to search...

> (Yes, in regular distutils you do have to pretty much walk the data
> directories to get your data.)

That's what I ended up doing.  Fortunately os.walk() makes it
fairly easy. :)

-- 
Grant Edwards                   grante             Yow!  Nipples, dimples,
                                  at               knuckles, NICKLES,
                               visi.com            wrinkles, pimples!!



More information about the Python-list mailing list