Home>Article>Backend Development> Can python replace JavaScript?
Python can replace JavaScript; Pajamas can be used to implement Python instead of JavaScript. Pajamas is an ajax development framework for Python that can be used to write network programs instead of HTML and JavaScript. Classes and modules can be reused and imported, and AJAX libraries can also solve interoperability issues.
The operating environment of this tutorial: windows10 system, Python3&&javascript version 1.8.5, Dell G3 computer.
Can python replace JavaScript
How great would it be if python could be used instead of Javascript to write browser-based applications? ah. However, Javascript is the only language that can be executed in the browser (except Flash or Silverlight).
Change the idea, first write the code in Python, and then convert it into a Javascript script through the compiler. This is indeed feasible. Well, someone has already done this, it is this: Pajamas
Introduction to Pajamas:
Pyjamas is an Ajax development framework for Python.
Google's Web Toolkit (GWT) allows us to develop Ajax-enabled Rich Internet Applications (RIA) entirely in Java™ code. You can use the rich set of Java tools (IDE, refactoring, code completion, debugger, etc.) to develop applications that can be deployed in all major web browsers. With the help of GWT, you can write applications that run in the browser but behave like desktop applications.
Similar to GWT, Pajamas is a cross-browser API. With it, you can write client-side functions in Python. The advantage of using Pajamas is that you can write web programs in Python instead of HTML and JavaScript, and you can reuse and import classes and modules. In addition, the AJAX library can also solve interoperability issues, so you don't have to worry about program compatibility issues on IE6, IE7, Firefox, Safari, Opera and other browsers.
Advantages of Pajamas: Use Python instead of HTML and JavaScript to write network programs.
Many people who use Google Web Toolkit (GWT) wonder why Python cannot be used instead of Java. It doesn't matter, just have Pajamas. Similar to GWT, Pajamas is a cross-browser API that allows you to write client-side functionality in Python. The advantage of using Pajamas is that you can write web programs in Python instead of HTML and JavaScript, and you can reuse and import classes and modules. In addition, the AJAX library can also solve interoperability issues, so you don't have to worry about program compatibility issues on IE6, IE7, Firefox, Safari, Opera and other browsers.
Extended Knowledge:
##Pyjamas 0.8 alpha1 has been released. Some updates in this version include:
javascript video tutorial、Python3 video tutorial】
The above is the detailed content of Can python replace JavaScript?. For more information, please follow other related articles on the PHP Chinese website!