On Tue, Aug 2, 2011 at 12:45 PM, Karim <kliat...@gmail.com> wrote:
> ...         for char in cellnames.replace('', ' ').split()[:cols]:

for char in cellnames[:cols]:

Strings are iterable over their characters. Alternatively, you could
use chr and ord, but it's probably cleaner and simpler to have the
string there. It also automatically and implicitly caps your columns
at 26. On the other hand, if you want to support more than 26 columns,
you may want to make your own generator function to yield 'A', 'B',...
'Z', 'AA', 'AB', etc.

ChrisA
-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to