Today I ran into an interesting runtime error using matplotlib.pyplot. This is going to get a bit technical. So if that is not your cup of tea just scroll down to the cute cat pic that deserves upvotes :D
So matplotlib.pyplot is commonly used in python to generate any type of plot: bar-charts, histograms, scatter-plots etc. For some applications you might only want to save the figure somewhere in a directory using .savefig() (and not actually show it using .show()). The weird thing is that if you end your figure generation with .savefig() the figure is still there even if the program you create saves a new figure. Generally, this won't be a big problem if you have a couple of figures but you might run into memory problems if you have hundreds of them. So it is good practice to close figures and you can do this with .close(). Here is the background info on .close. If you want to .show() and then .close() does that work? Well, .show() blocks .close() for some reason. So you need to unblock it using plt.show(block=False) and then you can .close() it. Here is a stack-exchange answer with a bit more background.
And now it is time for my cute cat!