0

I'm trying to save a lot of images. I have them codified as arrays and I realized that even though at the beginning the saving goes very fast it starts to get very slow when I have saved some of them. I found a solution to that by changing the name of the file I'm saving but don't know how to include two indexes in the file name. What I'm doing is this.

pt.savefig("Prueba%s.png"%i)

And when I try to do:

pt.savefig("%s.Prueba%s.png"%j, %i)

it says that I'm having a sintax error. I'm very new with python and I have tried many different things but nothing worked. Please help.

  • Possible duplicate of [Print multiple arguments in Python](https://stackoverflow.com/questions/15286401/print-multiple-arguments-in-python) – Gino Mempin Jan 17 '19 at 04:27

1 Answers1

0

You can use the format.

pt.savefig("{}.Prueba{}.png".format(j, i))

WEN WEN
  • 126
  • 2
  • 10