I am working with python and jupyter notebook, and I am writing code to save images to a folder. However, I am getting the error 'FileNotFoundError: [Errno 2] No such file or directory: 'plots/plot0.jpg'. I believe this is because I do not have a folder 'plots' in the current directory, and I was wondering how do add this. I have attached some code to see what is in the directory and how I am saving this image. Thank you!
img.save("plots/plot" + str(j) + ".png")
I ran this code:
import os
os.listdir()
and 'plots' was not in there, does this mean I need to create a new folder, and if so, how do I do that? Thank you!
'