Add python part to add-pattern.sh