Update monitor.py

import makedirs to create the temporary directory