[Tutor] Error in apparently correct code

Steven D'Aprano steve at pearwood.info
Tue Aug 21 05:21:06 CEST 2012


On 21/08/12 06:24, Osemeka Osuagwu wrote:
[...]
> p.s I apologise for the lack of comments


Don't apologise for lack of comments, apologise for posting in HTML which causes your code to be mangled, leading indentation stripped, and generally turned into an unreadable mess.

Indentation has meaning in Python. When you send email, if your email program (possibly GMail?) mangles the indentation, your code will become invalid, unreadable mess. You need to fix this. Often the easiest way to fix this is to *not* post so-called "rich text", actually HTML. Most mail programs will leave plain text emails alone, but if you send HTML, they will mangle *both* the text and the HTML.

(Aside: the HTML also increases the size of the email by about 300-400%.)

As a programmer, like any technician or craftsman, your tools make all the difference. Email is a tool. If your tool breaks your code, you need a better tool.


-- 
Steven


More information about the Tutor mailing list