-1

is it possible to run Python code in the background of my web/html pages, directly on internet?

Suppose I made a code with shuffle words (mix words), and I want to make an html page that have that python code in the background, to run that page as an application. Everytime someone will access that page, Python code will do the work.

Is it possible?

2
  • 1
    you mean like a "python implementation in js for the browser"? like this? or a server that runs python code and returns it to the client's browser? Commented Mar 2, 2023 at 10:23
  • Both version , but I believe the easier will be better... You are briliant. Yes, Python. Client Side from skulpt.org is a good solution of my request Commented Mar 2, 2023 at 11:40

1 Answer 1

0

Open the index.html and add the line inside the tag:

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1" />
    <title>Greetings!</title>
   <link rel="stylesheet" href="https://pyscript.net/releases/2022.12.1/pyscript.css" />
   <script defer src="https://pyscript.net/releases/2022.12.1/pyscript.js"></script>
  </head>
  <body>
   add the following line
  <py-script src="./main.py"></py-script>
  </body>
</html>

Source HERE:

Other Resources:

How to run python code directly on a webpage

How to run a Python script in a web page

https://dev.to/codemaker2015/how-to-run-python-code-in-your-browser-3i7e

https://www.youtube.com/watch?v=du8vQC44PC4&ab_channel=PatrickLoeber

https://www.youtube.com/watch?v=EZL-jobhKfo&ab_channel=KrishNaik

https://www.youtube.com/watch?v=BNM0752XPzw&ab_channel=CodeCove

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.