Extensions on Linux: import without underscore?

James Carroll mrmaple at gmail.com
Sun Jun 19 05:35:34 CEST 2005


Hi, I'm creating an extension called _bright.so on linux.  I can
import it with import _bright, but how can I import bright and get the
package?

On windows, I've been able to import bright instead of import _bright,
but on Linux it seems to need the underscore.  I'm tempted to create a
bright.py with from _bright import *, but I'm wondering if there's a
more direct way.

Also, I'm using scons to generate my lib, and it insists on prepending
the characters lib to my library name, so if I tell it to generate
_bright.so it gives me lib_bright.so.  Is there a way of turning this
off so I don't have to rename it back to _bright.so?

Thanks,
-Jim



More information about the Python-list mailing list