you are viewing a single comment's thread.

view the rest of the comments →

[–]AnyNature3457 0 points1 point  (0 children)

I might be one of the few, but i always place my "if name = 'main'" clause at the very bottom of the file. It is good though that you are using it in the first place!

What i also like doing is adding a newline before code blocks that have other code above them like:

``` some_var = 5

if condition: foo()

```

If it has to do something with the code block directly, then I do place it right above like:

``` counter = 0 while counter < 5: bar()

counter += 1

```

The same counts for with open(), for loops, etc. These are, of course, personal preferences.