python uses the for loop to save multiple instances of images or files

  • 2021-01-25 07:46:03
  • OfStack

In practical application, the operation of saving multiple files or images will be encountered. The basic requirements can be realized by using the for cycle:


for i in range(50):
 plt.savefig("%d.jpg"%(i+1))

We're done. Let's get 50 pictures out.

Similar to print formatted output:


print ("she is %d years old"%(18))

Related articles: