Mark Ch's answer didn't work for me as I was using Python 3. To make it work, you need to make a very simple change by making a comparison between two strings as follows :
import subprocess
if "SchoolWifiName" in str(subprocess.check_output("netsh wlan show interfaces")):
print "I am on school wifi!"