PyScript
Base64, PyScript, and WordPress
In a recent post, I found that WordPress misinterpreted indents and returned errors when I tried to run PyScript codes on it. It might be because WordPress detoxes the codes to turning them unfunctional for security reasons. So, I converted them into base64 to evade WordPress' watch. Code with no indent First, a code with no indent. I converted the above code into base64 and pasted into the py-script tag as src. The first two lines urge the browser to import the PyScript program. Results ↑No problem with hello world. Code with indents Next, a code with indents. Its result is what I am interested in. The above code was […]
Brief Review of PyScript on WordPress
Anaconda has introduced PyScript at PyCon US 2022. It enables client-side execution of Python codes in web browsers, and they say it is already compatible with Numpy, Pandas, and other third-party modules. I gave it a quick try on WordPress. Environment WordPress 5.9.3 Lightning 14.20.3 Safari 15.4 or Google Chrome 101.0.4951.54 MacOS 12.3.1 Apple M1 Pro Examples The custom HTML block seems to be the best place for PyScript codes. Some simplest codes work there. Results print("Hello, world!") Here comes the greeting! However, PysScript looks to override the default CSS settings, and the bold headings on this page are no longer bold. Similarly, bullet points of a list are missing. Whether […]