All parts of Python on my computer were recently installed from the Enthought academic package, but use Pyscripter for editing and running code. I\'m very early in my learning
There's nothing wrong with your code. I just tested it locally on my machine. The issue is this error:
IOError: [Errno 13] Permission denied: 'TestHist.png'
You are most likely trying to save the file somewhere that the Python process doesn't have permission to access. What OS are you on? Where are you trying to save the file?