How To Set Constraints In Python