On 19/10/14 23:26, Clayton Kirkwood wrote:
raw_table = ('''
a: Ask    y: Dividend Yield
b: Bid     d: Dividend per Share
b2: Ask (Realtime)           r1: Dividend Pay Date
...
o: Open’’’)

key_name = raw_table.rstrip('\t')

rstrip() strips characters from the *right* hand side. When it finds a character that is not a strippable character(the n of Open in this case) it stops.

If you want to replace all tabs with spaces or nulls then you need
to use string.replace() (or sub for regex)

HTH
--
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.flickr.com/photos/alangauldphotos

_______________________________________________
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
https://mail.python.org/mailman/listinfo/tutor

Reply via email to