If You Want top backlinks or free guest posting on our blog Lets do it Adsense Ready theme Now!

PyScript: Run Python On HTML

Get started with PyScript Using your favorite editor, create a new file called hello.html and fill it with the HTML code below.
PyScript: Run Python On HTML
PyScript: Run Python On HTML


I recently found an interesting project on github, it looks like this will be a new programming language in the future. How come? Now technology has advanced and developed over time.

What is PyScript

PyScript is a meta project that aims to incorporate several open technologies into a framework that allows users to create sophisticated browser applications with Python. It integrates seamlessly with the way the DOM works in the browser and allows users to add Python logic in a way that feels natural to both web and Python developers.

Please note that PyScript is very alpha and under heavy development. There are a lot of known issues, from usability to loading times, and you should expect things to change frequently. We encourage people to play and explore with PyScript, but we discourage using it for production at this time.

Try PyScript

To try out PyScript, import the appropriate pyscript file into your html page with:

<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>

You can then use the PyScript component in your html page. PyScript currently implements the following elements:

  • <py-script>: can be used to define executable python code inside a web page. The element itself is not rendered to the page and is only used to add logic.
  • <py-repl>: creates a REPL component that renders to the page as a code editor and allows the user to write executable code.

Check out the example directory folder for more examples of how to use it, all you need to do is open it in Chrome.


Get started with PyScript

Using your favorite editor, create a new file called hello.html and fill it with the HTML code below.

<html>
  <head>
    <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
    <script defer src="https://pyscript.net/alpha/pyscript.js"></script>
  </head>
  <body> <py-script> print('Hello, World!') </py-script> </body>
</html>

Then open the file in your favorite browser, and see how cool this one project is. Even though it's not perfect right now because it takes quite a long time to load. To learn more, please visit some of the reference links below.

Reference:

About the Author

Hi Greetings! thanks for reaching here, We are so delighted to welcome you on board. Your intelligence and energy make you an asset to your family and love ones.

Post a Comment

Cookie Consent
We serve cookies on this site to analyze traffic, remember your preferences, and optimize your experience.
Oops!
It seems there is something wrong with your internet connection. Please connect to the internet and start browsing again.
AdBlock Detected!
We have detected that you are using adblocking plugin in your browser.
The revenue we earn by the advertisements is used to manage this website, we request you to whitelist our website in your adblocking plugin.
Site is Blocked
Sorry! This site is not available in your country.