Python bindings tutorial
Stefan Behnel
stefan_ml at behnel.de
Wed Mar 17 08:18:33 EDT 2010
Dave Angel, 17.03.2010 12:14:
> Stefan Behnel wrote:
>> I think the point here is that executable binaries are not supposed to
>> be used as libraries. Libraries are. That's the difference between a
>> DLL and an executable in the first place. To run an executable,
>> execute it. The subprocess module is the tool of choice here. To use a
>> DLL, link against it.
>>
> There's no real reason parts of an exe cannot be exported, same as a
> dll. They are in fact the same structure. And in fact many other files
> in the Windows environment are also the same structure, from fonts to ocx's
So, because you can, you'd also try to link against fonts then, I guess?
I hope you notice that what you and me said isn't contradictory. But
there's a reason why there are libraries and executables, and there's no
reason you *should* export anything from an executable - that's what
libraries are there for. That's my point.
Besides, nothing guarantees that it's safe to call stuff that an executable
exports. The executable may well require some setup code that it only
executes when it is properly started.
Stefan
More information about the Python-list
mailing list