For me, this is magic

Could be this: Edit and run python code inside Logseq itself