For printing number with thousand separator, one can use the python format string :
\'{:,}\'.format(1234567890)
But how can I specify that
Here is bad but simple solution if you don't want to mess with locale:
locale
'{:,}'.format(1234567890.001).replace(',', ' ')