Skip to main content

TWAIN API for accessing scanners, cameras, etc on Windows

Project description

The Python TWAIN module provides an interface to scanners, digital cameras and
other devices which implement TWAIN, for the Windows platform. It provides the
functionality to allow a Python application to connect to the scanner/camera and
to retrieve images from that device.

The Python TWAIN module supports 32bit Windows only. It does not run on Apple
Computer Platforms or on UNIX based Platforms.

Example: Retrieve an image from a scanner

import twain
sm = twain.SourceManager(0)
ss = sm.OpenSource()
ss.RequestAcquire(0,0)
rv = ss.XferImageNatively()
if rv:
(handle, count) = rv
twain.DIBToBMFile(handle, 'image.bmp')

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page