Use python instead of bash script