Hey I'm fairly new to python, I'm currently studying Jython at University. So please forgive my ignorance.
Basically what I'm trying to do is create a "comic book" style picture using user selected images(easy enough) but because the number of pictures created is a variable, I've used a dict and assigned keys to each loop in the for function. But then I want to recall them again in another for loop. (also I'm aware theres possibly a few errors in my code, I'm just putting it up to give you an idea.
def comicStrip():
picture={}
totalWidth=0
totalHeight=0
pixelCount=0
loopCounter=0
pictureCount=requestInteger("How many pictures do you want in the comic strip?(1-4)")
while pictureCount <1 or pictureCount >4:
pictureCount=requestInteger("How many pictures do you want in the comic strip?(1-4)")
for p in range(1,pictureCount+1):
picture[p]=makePicture(pickAFile())
width[p]=getWidth(picture[p])
height[p]=getHeight[p]
totalWidth=totalWidth+width[p]
height=getHeight(picture[p])
if height > totalHeight:
totalHeight=height
cStrip=makeEmptyPicture(totalWidth, totalHeight)
while loopCounter < pictureCount:
for targetX in range(0,p1Width):
sourceY=0
for targetY in range(0,p1Height):
color = getColor(getPixel(picture1,sourceX,sourceY))
setColor(getPixel(cStrip,targetX,targetY),color)
sourceY=sourceY+1
sourceX=sourceX+1
addRectFilled(cStrip,0,0,p1Width,20,white)
addRect(cStrip,0,0,p1Width,20)
addRect(cStrip,0,0,p1Width,p1Height)
caption=requestString("Enter the caption for this picture.")
addText(cStrip,1,19,str(caption))