The Python twain module has a shortcoming. It’s summed up by this quote in the documentation; “The twain module can only be used in an application with a message loop”. This is (as far as my limited research can find out) in the design of the whole TWAIN system on Windows; as image acquisition progresses, the calling application is notified of progress via a series of messages.
On Windows, that means you need a window, since messages are sent to windows. Which means Windows has to be logged on, more or less Now, maybe I’m just a tired old Unix hound who’s spent too much of his life writing daemon code that executes in the dark bowels of the machine where no human could be or would want to be, but I rather like systems that can automate stuff without assuming there’s someone sat in front of the damn box. What if there’s been a powerfail and the system isn’t logged in? Should all Windows servers require a human whose job is to scurry around them and check for rogue dialogue boxes?
No, of course not. Yet it’s tedious and annoying that I can’t write my little Python script to make my camera take a picture every hour without messing in wxWindows. Hey ho.
Oh, and if you don’t read the excellent Rupert Goodwin’s Diary on a Friday, you should.