The following prints a decimal number with commas as thousands separator:
num = 123456789
print(f"{num:,}")
123,456,789
According to PEP-378 (which seems relevant here?), the separator can be a comma, dot, space, apostrophe or underscore. I managed to get an underscore:
print(f"{num:_}")
123_456_789
But how do I get a dot, space, or most importantly to me, an apostrophe?