Have you tried like in the other thread you referenced? So instead of using /bin/bash -c directly using python?