Code changes to make external python work in windows. Changes credit to WiSo