Employed specific arithmetic methods for performance when getting new values.
Initialise xrangeiterator with only pertinent details, not xrange objects.
1fromsysimportstdin 2 3print"Reading 10 bytes..." 4s=stdin.read(10) 5prints 6 7print"Reading to end of file..." 8s=stdin.read() 9prints