Attaching Python Code

How do I do this?
.py and .txt are not accepted and the code is really too long to insert in the post.

Probably way simpler to just host it externally and link it - are two options…

Thanks didn’t know either of them but I have signed in tohttps://pastebin and put my code up there.
I wanted it available to try and get an answer to another post:

Just a heads up - I don’t see the code linked anywhere :wink: