[Tutor] Why are these results different?
sanelson at gmail.com
Thu Nov 19 09:24:09 CET 2009
I'm seeing different behaviour between code that looks to be the same.
It obviously isn't the same, so I've misunderstood something:
>>> logs = itertools.chain.from_iterable(glob.glob('%sded*/%s*%s.gz' % (source_dir, log, date)) for log in log_names for date in log_dates)
>>> for log in logs:
... print log
for date in log_dates:
for log in log_names:
logs = itertools.chain.from_iterable(glob.glob('%sded*/%s*%s.gz'
% (source_dir, log, date)))
Gives me one character at a time when I iterate over logs.
Why is this?
And how, then, can I make the first more readable?
More information about the Tutor