Re: getting a python module accepted by python?
On Tue, 26 Dec 2000, Sean 'Shaleh' Perry wrote:
> Is there a way to make a site-packages/foo/foo.py without requiring a change
> in programs calling foo?
No, and I dont think its wise to create an own subdirectory for a single
file. Just leave the file in site-packages/.
> Also, sorry to get off topic, but should the postinst compile the module?
Yes, see the postinst for python-base.
> Won't this happen the first time the module is imported?
Yes and no, it depends on the write permissions of the user. If I have
write permission to /usr/lib/python1.5/site-packages then the .pyc (or
.pyo) file is created. If not, then no compiled file will be
created. Thats the reason you should compile .py files with the postinst
Note: .pyc files are not binary compatible, so if you are working with
Python 2.0 and distribute .pyc files for Python 1.5 (or vice versa) they
might not work.
Thats another reason to compile with postinst.