~ubuntu-branches/ubuntu/wily/python-imaging/wily

« back to all changes in this revision

Viewing changes to Sane/demo_pil.py

  • Committer: Package Import Robot
  • Author(s): Matthias Klose
  • Date: 2013-01-31 20:49:20 UTC
  • mfrom: (27.1.1 raring-proposed)
  • Revision ID: package-import@ubuntu.com-20130131204920-b5zshy6vgfvdionl
Tags: 1.1.7+1.7.8-1ubuntu1
Rewrite build dependencies to allow cross builds.

Show diffs side-by-side

added added

removed removed

Lines of Context:
4
4
# Shows how to scan a color image into a PIL rgb-image
5
5
#
6
6
 
 
7
from __future__ import print_function
 
8
 
7
9
# Get the path set up to find PIL modules if not installed yet:
8
10
import sys ; sys.path.append('../PIL')
9
11
 
10
12
import sane
11
 
print 'SANE version:', sane.init()
12
 
print 'Available devices=', sane.get_devices()
 
13
print('SANE version:', sane.init())
 
14
print('Available devices=', sane.get_devices())
13
15
 
14
16
s = sane.open(sane.get_devices()[0][0])
15
17
 
16
18
s.mode = 'color'
17
19
s.br_x=320. ; s.br_y=240.
18
20
 
19
 
print 'Device parameters:', s.get_parameters()
 
21
print('Device parameters:', s.get_parameters())
20
22
 
21
23
# Initiate the scan
22
24
s.start()