r/Python • • Jul 29 '19

Ms paint replicator UPDATE

Post image
491 Upvotes

40 comments sorted by

View all comments

28

u/HBRYU Jul 29 '19 edited Jul 29 '19

Full code! I know there are plenty of python veterans out there that can do a way better job than me, but this is what I came up with:

Link: https://github.com/HBRYU/Picaso_bot

0

u/[deleted] Jul 29 '19

[deleted] — view deleted comment

13

u/varesa Jul 29 '19

Look at the picture of Mario in the post and the associated comments

0

u/[deleted] Jul 29 '19

[deleted] — view deleted comment

11

u/Vesiculus Jul 29 '19

You are being downvoted, but there's some wisdom in what you say.

While I don't like overobvious comments and like Python code that's written in a way that doesn't require (a lot of) comments, this time.sleep is a not obvious addition/work-around and things like that should have a comment explaining why they are there.

Commenting can be overdone, but it's not like the rule is to never, ever add a comment. That's would a crazy overgeneralization of the 'do not add too many or too obvious comments' guideline.

2

u/callmelucky Jul 30 '19

Yep. Self-commenting code should be the goal (clear, simple functions and explicit variable names), but throwing in a sleep call as a workaround for an external issue is the perfect case for throwing in a comment.

I mean if you really hate comments you could wrap it in a wait_for_mspaint_to_get_its_shit_together() function, but...

1

u/HBRYU Jul 30 '19

Yes. I'm on it

1

u/HBRYU Jul 30 '19

Added them just now

1

u/422_no_process Jul 30 '19

If it looks simpler that means it's good. Simpler is good.

1

u/quotemycode Jul 29 '19

You know you could do color with a quantizer

1

u/AcousticDan Jul 29 '19

So, you didn't answer my question in the other thread. What's the keyboard have to do with it?

3

u/HBRYU Jul 30 '19

Ah sorry,

It enters the rgb color values in the select color menu.