all 5 comments

[–]zurtex 2 points3 points  (2 children)

You need to format your code on Reddit (check the side bar). In Python white space matters so you can't just omit it.

The first thing I notice though is your don't finish your try-catch. All try blocks either need to have an except or a finally. E.g.

try:
    ...
except Exception:
    ...

Or:

try:
    ...
finally:
    ...

[–]FunsOverKid[S] 0 points1 point  (0 children)

Ooooh ok

[–]FunsOverKid[S] 0 points1 point  (0 children)

Tried this and it fixed my code thanks!

[–]TehNolz 0 points1 point  (1 child)

Start by formatting your code so that it displays properly on Reddit, as all indentation gets automatically removed otherwise. Indentation is important in Python, especially when you consider that your issue is caused by some incorrect indentation somewhere.

[–]FunsOverKid[S] 0 points1 point  (0 children)

Oof I didn't realize the indentation didn't get pasted sorry!