Hi, I have this problem where I have to make a function that takes one parameter and draws two vertical lines, one is a red line from (50,0) to (50,300) and one made up of randomly colored pixels(150,50)to (150,250).
I didn't define my function yet but for some reason my random part isn't working.
I cannot figure out whats wrong. It says "Float object has no attribute int".
I tried to put rand also but didn't work. Do I need to convert something?
This is my code:
from cImage import*
import random
RandomColor = random.random()
myImWin = ImageWin("Line Image", 300, 300)
lineImage = EmptyImage(300,300)
redPixel = Pixel(255,0,0)
randomRed = Pixel(RandomColor.int(0,255))
for i in range(300):
for x in range(250):
lineImage.setPixel(50,i,redPixel)
randomRed.setPixel(150,x,randomRed)
lineImage.draw(myImWin)
randomRed.save("lineImage.gif")