title: Creating an animated gif with PIL that does not loop
body: <p>I've been able to create animated gifs that loop infinitely using PIL without an issue, usually ending up with something like   </p>
  
  <p><code>final_image.save('/path/to/images/some.gif,
    save_all=True,
    append_images=frames_images,
    duration=frame_speeds,
    loop=0)</code></p>
  
  <p>I am now in a situation where I would like to create a gif that plays a single time and does not loop.  The PIL docs I used¹ are pretty clear about the loop argument but don't offer any advice for my situation:    </p>
  
  <blockquote>
    <p>loop : int<br>
    The number of iterations. Default 0 (meaning loop indefinitely).</p>
  </blockquote>
  
  <p>0 causes it to loop infinitely.  1 causes it loop once (play two times).  I have tried options like -1 and None but can't find a working argument.  I am currently using a work around where I invoke gifsicle afterwards to remove the loop entirely but was hoping PIL would support this natively</p>
  
  <p>¹ - <a href="https://imageio.readthedocs.io/en/stable/format_gif-pil.html" rel="noreferrer">https://imageio.readthedocs.io/en/stable/format_gif-pil.html</a>  </p>