Just a detail: your rect(100,100,100) statement is missing the 4th argument (height). 
def setup():
size(500, 500)
def draw():
rect(100, 100, 100, 100)
Have you already explored the Python sketch examples to check if they work? Hit CTRL+SHIFT+O for it. 