Is there a way to do this without resorting to os.system? Is there an api we can use instead, I never like just relying on system commands :/