Use proc.communicate()