import imageio, os, sys
def png_gif(path):
png_lst = os.listdir(path)
frames = []
for i in png_lst:
frames.append(imageio.imread(path + i))
# for i in range(0, 51):
# i = i*4 + 1
# k = str(i)
# z = k.zfill(4)
# frames.append(imageio.imread(path + "/pten" + z + ".png"))
imageio.mimsave("result.gif", frames, 'GIF', duration=0.5)
def main():
path = str(sys.argv[1])
png_gif(path)
if __name__=="__main__":
main()