[Python] Python: Get the Source State in Twain

Discussão em 'Python' iniciado por Stack, Março 24, 2025.

  1. Stack

    Stack Membro Participativo

    I have a python script where I am using Twain to interact with my scanner. First I initialize my source:

    scanner = sm.OpenSource()


    set a few capabilities then request to acquire an image:

    scanner.RequestAcquire(0, 1)


    I then try to transfer an image:

    scanner.XferImageNatively()


    I get a Twain Sequence error, the docs tell me this happens when it is in the incorrect state. I can not for the life of me find in the docs how to check said state though. Can anyone offer some assistance??

    I would like to check the state and wait until my scanner is in a valid state.

    Continue reading...

Compartilhe esta Página