View Full Version : Python image editing

18-10-2011, 10:06 PM

I have posted to a Python forum but it does not seem to be very active. Any Python programmers out there? My problem is:

Thought I would have a go at image manipulation with Python (I am a fairly inexperienced programmer). I am using the text book "Fundamentals of Python" by Kenneth Lambert (see http://home.wlu.edu/~lambertk/python/) (http://home.wlu.edu/%7Elambertk/python/%29). I downloaded the images.py supplied here and am not having much luck.
I am using Python 2.6 running on Ubuntu and /or Python 2.7 using IDLE on a XP virtual machine - can't get either to do anything sensible. Once I get one error fixed another one pops up. All I am trying to do initially is load an image.
My current (simple) code is:

#! /usr/bin/python
# from PIL import Image
from images import Image
from numpy import *
import os,sys



The error I am getting from that is:

Traceback (most recent call last):
File "./TrialImage.py", line 3, in <module>
from images import Image
File "/home/johnd/Documents/......../images.py", line 39, in <module>
class ImageView(tk.Canvas):
AttributeError: 'module' object has no attribute 'Canvas'

I wonder if somebody would be keen to point me in the right direction?

19-10-2011, 12:52 AM
Have you thought of emailing the dude who does the "Programming" section in the PCWorld mag? as i swear there was a few issues to do with Python. That dude will probably be able to help. He must have an email or something.