I\'m trying to write a python function not using any modules that will take a string that has tabs and replace the tabs with spaces appropriate for an inputted tabstop size.
For a tab length of 5:
>>> s = "123\t123" >>> print ''.join('%-5s' % item for item in s.split('\t')) 123 123 >>>