This takes some sophistication to set up, but you can use this Experimental Code Column to do this:
It runs a serverless function on Vercel, which in this repo is written in TypeScript but Vercel supports Python as well. You would create a Python function, then change the code in index.tsx
to call your Python function over the network.