read input from stdin, write to stdout working in python 2 and 3 and handles remote urls for input