check Python version and return mem usage in template script