Conversation
Notices
-
Embed this notice
Pleroma-tan (kirby@lab.nyanide.com)'s status on Tuesday, 09-Apr-2024 00:03:14 JST Pleroma-tan @sysrq well python itself is a weird 3 language hybrid mix but im not familiar with a lot of python so i have no idea how code is "societally accepted" to be formatted. i end up writing it like c instead and it looks weird compared to other code -
Embed this notice
pwm (pwm@crlf.ninja)'s status on Tuesday, 09-Apr-2024 00:27:34 JST pwm @kirby @sysrq try flake8, that's what my shop used Pleroma-tan likes this.Pleroma-tan repeated this. -
Embed this notice
pwm (pwm@crlf.ninja)'s status on Tuesday, 09-Apr-2024 00:28:08 JST pwm @kirby @sysrq you can add extensions that cover type hints and such if you like Pleroma-tan likes this. -
Embed this notice
Max Mustermann (maxmustermann@shitposter.world)'s status on Tuesday, 09-Apr-2024 00:37:47 JST Max Mustermann @pwm @kirby @sysrq Flake 8 has the most autism sorted out and teaches you how to create acceptable Python code. I got to the point where I can pick which rule to ignore and still have some readable code.
def get_place(): towns = ["a"] # There would be normally a bunch of goofy town names. I have replaced them with a single entry, 'a', states = [ "AK", "AL", "AR", "AS", "AZ", "CA", "CO", "CT", "DC", "DE", "FL", "GA", "GU", "HI", "IA", "ID", "IL", "IN", "KS", "KY", "LA", "MA", "MD", "ME","MI", "MN", "MO", "MS", "MT", "NC", "ND", "NE", "NH", "NJ", "NM", "NV", "NY", "OH", "OK", "OR", "PA", "PR", "RI", "SC", "SD", "TN", "TX", "UT", "VA", "VI", "VT", "WA", "WI", "WV", "WY", ] return f'{towns[randint(0, len(towns) - 1)]} {states[randint(0, len(states) - 1)]}'Pleroma-tan likes this.
-
Embed this notice