'Pixel' object has no attribute 'setPixel' error, cannot figure out why this is
<p>This code down below should draw two vertical lines, one red line from (50,0) to (50,300) and one made up of random pixels from (150,50) to (150,250). Where it says randomRed.setPixel(150,x,randomRed) on line 13, it points out that 'Pixel' object has no attribute 'setPixel' error. I cannot figure out why this is an error. I have to setPixel right?</p>

<pre><code>from cImage import*
import random


myImWin = ImageWin("Line Image", 300, 300)
lineImage = EmptyImage(300,300)
redPixel = Pixel(255,0,0)
randomRed = Pixel(random.randint(0,255),0,0)
for i in range(300):
    for x in range(250):
    lineImage.setPixel(50,i,redPixel)
    randomRed.setPixel(150,x,randomRed) # here is the error it points out
lineImage.draw(myImWin)
randomRed.save("lineImage.gif")

myImWin.exitonClick()
</code></pre>
