Recommand · May 22, 2021 0

Greate jpg or png file from turtle, Python

I have a littel problem with my code, my program in python make a Watch in Turtle. I can make the file in eps format, but not in png or jpg format.
I get following error. : Unable to locate Ghostscript on paths

What is going wrong, with my code. I need help to this problem.

def main_ur():
   moveHourHand()
   moveMinuteHand()
   turtle.update()
   fileName = 'test'
   wn.tracer(False)
   wn.tracer(True)
   canvas = wn.getcanvas()
   canvas.postscript(file= fileName+'.eps', width=400, height=500)
   img = Image.open(fileName + '.eps') 
   img.save(fileName + '.png', 'png') 
   wn.exitonclick()

if __name__ == "__main__":
   main_ur()