Re: catching empty strings (I guess that's what they are)

2007-07-09 Thread Alex Martelli
Diez B. Roggisch <[EMAIL PROTECTED]> wrote: ... > for uf in user_files: > uf = uf.strip().lower() > if uf: >file_skip_list.append(uf) This is fine; however, another reasonable alternative is: if not uf.isspace(): file_skip_list.append(uf.strip().lower()) I prefer yo

Re: catching empty strings (I guess that's what they are)

2007-07-09 Thread brad
Diez B. Roggisch wrote: > They are still there because you perform the stripping and lowercasing in > the append-call. Not beforehand. Thank you. I made the changes. It works. -- http://mail.python.org/mailman/listinfo/python-list

Re: catching empty strings (I guess that's what they are)

2007-07-09 Thread Diez B. Roggisch
brad wrote: > I've began accepting user input :( in an old program. The input comes > from a simple text file where users enter filenames (one per line). What > is the appropriate way to handle blank lines that hold whitespace, but > not characters? Currently, I'm doing this: > > for user_f

catching empty strings (I guess that's what they are)

2007-07-09 Thread brad
I've began accepting user input :( in an old program. The input comes from a simple text file where users enter filenames (one per line). What is the appropriate way to handle blank lines that hold whitespace, but not characters? Currently, I'm doing this: for user_file in user_files: