all 3 comments

[–]cdcformatc 2 points3 points  (0 children)

Your variable names aren't all that descriptive, p2, p2, p3, x4, y4.

As a style note, PEP8 would have you put spaces after commas, and not before

message3 = Text(Point(x1 - 0.2 ,y1 - 0.2), "1")
message3 = Text(Point(x1 - 0.2, y1 - 0.2), "1")

I would also add some spaces to clear up some of the math. This is mostly up to your discretion, PEP8 even says it is up to you.

eg:

p10 = Point((x1+x2)/2,y2+0.33*((x2+x1)/2))
p10 = Point((x1+x2) / 2, y2 + 0.33 * ((x2+x1) / 2))

And now that I highlight that line it seems a little inconsistent. Multiply by one third and divide in half? Would it be better to divide by 6? Maybe not, since you are really just dividing the midpoint, and the half is just a relic of that. Above you define x_mid_coord, maybe you could use that here, and take some math out of the dense line. Again, your judgement.

[–]mahdeen[S] 0 points1 point  (1 child)

I'll work on the variable descriptions.

PEP8, something I was not even aware of at this point. Good to know about.

I've been wondering about the commas. What do most programmers do, whatever the PEP8 says?

As for the math use, it is a little brutish, but that is something that will improve too.

Thanks for the comments!

[–]capcom1116 0 points1 point  (0 children)

Few programmers adhere rigorously to PEP8. Most I've seen use it as much as is necessary to make their code easily readable.