fix stdout option for python 2 and 3, add option for remote input url

This adds support for remote urls and conditionally writes to stdout buffer for python 3