We have seen Tech Influencers showing Javascript less importance for a couple of days because of the new PyScript.
Which is executable via web browsers and developer-friendly as easy to integrate inside HTML
As developers, we are always curious to test out the new technologies and engage with them.
Here in this blog post, I will be sharing my opinion, experience and thoughts using both Javascript and Python for a couple of years, and I also will be sharing my experience using PyScript.
What is PyScript
PyScript is a new Framework powered by Pyodide and Web Assembly that allows us to run python in web browsers. It's useful for web developers to run python in the browser, write custom logic, and enhance the application's features and functionalities.
PyScript is not yet fully ready. It is still in the beta phase and not recommended for production applications.
How PyScript Work
PyScript is just a Javascript module that allows you to execute python scripts in the web browsers like javascript. As a web developer now, you can write Python scripts on the Frontend side and improve the functionality of your website or web application
How to Run PyScript
<!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" /> <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" /> <script defer src="https://pyscript.net/alpha/pyscript.js"></script> <title>pyscript</title> </head> <body> <h2>Hello World</h2> <py-script> print('Now you can!')</py-script> </body> </html>
Advantages of PyScript
PyScript will definitely be adding more power to python developers. It will surely add more value to their work and make things easier.
There are a lot more. You can use the popular python libraries
My thoughts about PyScript
Of course, PyScript won't be replaced with Javascript. PyScript runs on top of javascript. As we know, Javascript is much faster and smoother than python,
My First impression of PyScript was broken. When I tested it on my local machine for the first time, it took a long time to display the web page. If you face any network issues or have a slow internet connection, it will not display the written python script.
Javascript always wins in case of performance. As a JavaScript developer, I don't like the python indentation, where you have to check every possible way to check for the proper indentation,