On 2015-05-19, Cecil Westerhof <[email protected]> wrote:
> At the moment I want my code to run with 2.7 and 3.4+.
>
> But the command:
> subprocess.getstatusoutput
> does not exist in 2.7. Is this an oversight or is there a reason for
> it?
>
> I can rewrite the code (back) to work with Popen again, but I found
> the getstatusoutput elegant.
It's in the 'commands' module in Python 2. You could use the
following:
try:
from subprocess import getstatusoutput
except ImportError:
from commands import getstatusoutput
--
https://mail.python.org/mailman/listinfo/python-list