Add brackets to python script