Forum Home
Press F1
 
Thread ID: 121261 2011-10-18 09:06:00 Python image editing johnd (85) Press F1
Post ID Timestamp Content User
1238279 2011-10-18 09:06:00 Hi

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 home.wlu.edu) (home.wlu.edu). 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


image=Image('SamplePhotos/00007.jpg')
image.draw()

t.getscreen()._root.mainloop()

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?
Thanks
John
johnd (85)
1238280 2011-10-18 11:52:00 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. goodiesguy (15316)
1