Using proc.communicate() instead of stdout.read()