[Tutor] rstrip() failure ?

dave s pythontut at pusspaws.net
Wed Aug 9 22:45:22 CEST 2006


I have a string problem. The following code skips the loop if the string 'app' 
is on the banned list ...

self.ban_app_list = 
[' ', 'live_dat', 'exact_sl', 'html_str', 'valid_da', 'datacore', 'check_co', 'logger']

if app in self.ban_app_list:
	continue

the string 'app' is derived from some more string splicing. All works well 
except for 'logger', the 'app' string becomes 'logger  ' so no match. So I 

app.rstrip()

thinking it would sort the problem. no go :(

len(app) is still 8. OK ... I am stuck ...

Is there a way to show the ascii values of the string - kind of hexedit for a 
string

I am sure the padding blanks are just spaces rstrip() appears to disagree

Any help greatly appreciated

Dave


More information about the Tutor mailing list