Is it possible to do this without subprocess?