best bet for using a .NET dll

Fuzzyman fuzzyman at gmail.com
Tue Nov 21 10:37:15 EST 2006


Warren Jackson wrote:
> I'd like to make a simple program that uses the Canon digital camera
> SDK (EDSDK 1.3).  Basically I need to take pictures and download them
> to my computer.  They have a fair amount of example code for the .NET
> languages, and don't officially support anything else.
>
> The API uses more than the basic c types (references, etc.) that I'm
> not totally familiar with yet.  Included at the bottom is an example
> of one of the functions.
>
> What is my best bet for writing this in Python? cTypes, IronPython,
> something else?  I haven't worked with either before but am currently
> reading up.  It seams cTypes has a difficult time dealing with
> anything but the 'normal' c types, is this correct?
>
> Would it be easier to just write a program in C# to handle all of the
> fancy types? (ie. make a function that opens and closes session, finds
> camera, takes picture, downloads picture, saves picture - that can
> then be read in python) ?  This isn't a very attractive option to me.
>
> Thanks in advance for any insight.
>

This sounds like the sort of thing for which IronPython is ideal. It
should eliminate the need for C# unless you have to mark classes with
attributes (In which case you should be able to get away with a stub
class.)

Fuzzyman
http://www.voidspace.org.uk/index2.shtml




More information about the Python-list mailing list