Bash is getting messy, let's try python