I tested sys.stdout.write in interactive mode; why do I get the 'extra' 1 and 2 suffixed to the numbers? If I run the code from a file I get the expected output (1234...) Python 3.3 on a Windows machine
>>> import sys
>>> for i in range(15):
... sys.stdout.write(str(i))
...
01
11
21
31
41
51
61
71
81
91
102
112
122
132
142
>>>