I'm looking for an easy way to run some Python code on my WordPress website. I already have the code ready and would appreciate guidance or tips on how to implement it effectively.
4 Answers
Check out Brython (brython.info). It's a way to run Python in the browser. However, compatibility and performance might vary, so it’s worth testing first!
If you're not looking to rewrite the code, there are only some pretty hacky methods. You could try something like executing shell commands through a WordPress plugin, but it's really not ideal and can pose security risks.
Just a heads up, I don't think there’s a straightforward way to run Python on WordPress without some serious workarounds. You might need to consider rewriting the Python script in PHP or using a plugin that allows executing server-side scripts.
First things first, what does your Python code actually do? Knowing the purpose can help figure out how to run it on WordPress. Just asking to clarify before suggesting anything further!
It's meant to scrape data from a webpage.