#Processing & #py5 tip:
Remember the shapes you put on draw() will be redrawn over and over, and if they don't move (leaving a trail) you might want to either clean each frame with background(...), or stop the draw loop (noLoop() in Processing or no_loop() in py5), otherwise you kill the anti-aliasing of the lines/strokes/edges!
I'm posting this tip because even using these tools for years and knowing this, today I briefly thought something was odd/broken because my lines were ugly with no "smoothing" :D
import py5
def setup():
py5.size(200, 200)
py5.stroke_weight(2)
# a line that will drawn once only
py5.line(10, 10, 190, 90)
def draw():
# you could clean the frame here with background(200)
# this other line will be redrawn many times
py5.line(10, 110, 190, 190)
def key_pressed():
py5.save('out.png')
py5.run_sketch()