use python file object instead of /bin/cat