22 Jul
2020
22 Jul
'20
6:22 a.m.
I find the need for that regularly. And I use the obvious syntax which everyone else uses:
if not seq: print("This page is intentionally left blank") else: for i in seq: ...
Not so easy for an iterator though. I’m more likely to do something like this: Page = NewPage() For content in iterable: Page.Add_stuff(content) If not Page: print("This page is intentionally left blank") (Sorry For the non PEP8 compliant capitalization— damn phone) -CHB
--
Christopher Barker, PhD Python Language Consulting - Teaching - Scientific Software Development - Desktop GUI and Web Development - wxPython, numpy, scipy, Cython