Add pre-build scripts to Python templates