Update outputting-csv.txt

Improved the fix for #21179, by switching from xrange() to range(), and restating the import as a Python 2 compatibility import.