0

Hi Goodies i have an issue in pyscript issue : when i paste the below pyscript code in my WordPress post as an html and press preview it just simply popups to dawnload the pyodide file instead of showing the hello world message in the code below. Please someone can clear that to me why this is happening. thanks regards

<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
    <script defer src="https://pyscript.net/latest/pyscript.js"></script>
</head>
<body> 
    <py-script> print('Now you can!') </py-script>|
</body>
</html>

the output screenshots from the browser where i get this happening. (1) From WordPress

this is once i write the code in real time wordpress post as an html this is what i got once i click on preview

(2) Samething is happening in vscode live server instead of the showing the message hello world it just popup my dawnloader idm to dawnload a pyodide file. this is the code in vscode with the live server this is what i got once i run with the live server in vscode

i need to run a small python code in my WordPress post when someone visit my website and in that post once he requests some calculation so the python code should be responsible to do some calculations and show that to the user.

any suggestions please

1 Answers1

0

From the logo on the popup messages you're getting in both cases, it looks like this is behavior caused by having Internet Download Manager (IDM) installed.

When the Pyodide runtime loads, it fetches certain additional files from the web, including pyodide_py.tar (the compressed Python API files the Pyodide Python API, as well as any additional packages specified in <py-config>. If IDM is configured to interrupt fetching these necessary files, Pyodide will fail to load and/or execute.

You may be able to whitelist (allow) IDM to automatically download these files, but that's beyond my knowledge of that particular plugin.

For more discussion, here's a similar issue on the PyScript GitHub.

Jeff Glass
  • 622
  • 1
  • 8