On Wednesday 09 August 2006 20:45, dave s wrote:
> 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
> _______________________________________________
> Tutor maillist  -  Tutor@python.org
> http://mail.python.org/mailman/listinfo/tutor

Stupid basic error held me up for a couple of hours :)

app.rstrip()  should have been
app = app.rstrip()
_______________________________________________
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor

Reply via email to