Pyjs
   HOME

TheInfoList



OR:

Www.google.com (formerly Pyjamas before May 2012), is a rich web application framework for developing client-side web and desktop applications in
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
. The resulting applications can be run in a
web browser A web browser is application software for accessing websites. When a user requests a web page from a particular website, the browser retrieves its files from a web server and then displays the page on the user's screen. Browsers are used on ...
or as standalone
desktop application A desktop traditionally refers to: * The surface of a desk (often to distinguish office appliances that fit on a desk, such as photocopiers and printers, from larger equipment covering its own area on the floor) Desktop may refer to various compu ...
s. It contains a stand-alone
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
-to-
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
compiler, an
Ajax framework Ajax may refer to: Greek mythology and tragedy * Ajax the Great, a Greek mythological hero, son of King Telamon and Periboea * Ajax the Lesser, a Greek mythological hero, son of Oileus, the king of Locris * ''Ajax'' (play), by the ancient Greek ...
and
widget toolkit A widget toolkit, widget library, GUI toolkit, or UX library is a library or a collection of libraries containing a set of graphical control elements (called ''widgets'') used to construct the graphical user interface (GUI) of programs. Most widg ...
, and through use of these components, developers can write comprehensive applications, to run in all major web browsers, without writing any JavaScript. Pyjs is a port of
Google Web Toolkit Google Web Toolkit (GWT ), or GWT Web Toolkit, is an open-source set of tools that allows web developers to create and maintain JavaScript front-end applications in Java. It is licensed under the Apache License 2.0. GWT emphasizes reusable ...
(GWT) from
Java Java (; id, Jawa, ; jv, ꦗꦮ; su, ) is one of the Greater Sunda Islands in Indonesia. It is bordered by the Indian Ocean to the south and the Java Sea to the north. With a population of 151.6 million people, Java is the world's List ...
to
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
.pyjs README
/ref>


Development

Using pyjs, developers can write
web application A web application (or web app) is application software that is accessed using a web browser. Web applications are delivered on the World Wide Web to users with an active network connection. History In earlier computing models like client-serve ...
s in
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
instead of
JavaScript JavaScript (), often abbreviated as JS, is a programming language that is one of the core technologies of the World Wide Web, alongside HTML and CSS. As of 2022, 98% of Website, websites use JavaScript on the Client (computing), client side ...
. The application is compiled to JavaScript. Also included is an Ajax library and widget setThe ui Module Class Hierarchy
/ref> that provides access to the Document Object Model (DOM) of modern JavaScript-capable web browsers. The Ajax library and the widget set library are a hybrid mix of Python and JavaScript. Just as with Google Web Toolkit, pyjs is not its libraries, and neither is it just another Ajax framework.
Ajax framework Ajax may refer to: Greek mythology and tragedy * Ajax the Great, a Greek mythological hero, son of King Telamon and Periboea * Ajax the Lesser, a Greek mythological hero, son of Oileus, the king of Locris * ''Ajax'' (play), by the ancient Greek ...
s are strictly limited to providing pre-prepared specific functionality, written almost exclusively in tailor-made JavaScript. Both GWT and pyjs, being JavaScript compilers, allow the developer to work in the language with which they are familiar (Java or Python, respectively), to write their own custom widgets, either entirely from scratch or based on the existing available widgets, yet still target the full range of modern browsers. So, far from presenting web developers with a ''fait-accompli'' Ajax framework, pyjs gives you the freedom to develop your own.


Design

The pyjs compiler is written in the programming language Python, and uses it to compile its input into JavaScript, walking the
abstract syntax tree In computer science, an abstract syntax tree (AST), or just syntax tree, is a tree representation of the abstract syntactic structure of text (often source code) written in a formal language. Each node of the tree denotes a construct occurring ...
of the program being compiled. Although the compiler is stand-alone, the primary use of pyjs is for web development, so there is additional infrastructure for building web applications. The DOM.py model library is an abstraction layer - a thin layer of Python on top of JavaScript code snippets - use of which provides access to the full
Document Object Model The Document Object Model (DOM) is a cross-platform and language-independent interface that treats an XML or HTML document as a tree structure wherein each node is an object representing a part of the document. The DOM represents a document wi ...
of the target browser platform. As with any compiler, the JavaScript snippets are treated as
inline assembler In computer programming, an inline assembler is a feature of some compilers that allows low-level code written in assembly language to be embedded within a program, among code that otherwise has been compiled from a higher-level language such as C ...
. Furthermore, on top of the DOM.py model library is an additional abstraction layer, ui.py, which provides the most useful layer to web developers: a full suite of widgets with which desktop application developers will be familiar. At present, the list of available widgets is a mixture of the complete set of widgets that were available in Google Web Toolkit 1.2, along with a few more that have been forward-ported from GWT 1.5.


Components

The major Pyjs components include: ;pyjs Python-to-JavaScript Compiler :Translates the programming language Python into JavaScript. ;Python builtin and standard emulation library :JavaScript implementations of the commonly used modules, builtins and classes in the Python standard runtime library (such as strings, lists, dictionaries, tuples, sets, getattr, map, filter, range, etc.; basic exception handling, a basic datetime and a basic math module). ;pyjs DOM libraryDOM module
/ref> :Modules for manipulating the browser
DOM Dom or DOM may refer to: People and fictional characters * Dom (given name), including fictional characters * Dom (surname) * Dom La Nena (born 1989), stage name of Brazilian-born cellist, singer and songwriter Dominique Pinto * Dom people, an et ...
. ;pyjs Web UI moduleui module
/ref> :A module for creating widgets as if the web browser was a desktop
widget engine A software widget is a relatively simple and easy-to-use software application or component made for one or more different software platforms. A desk accessory or applet is an example of a simple, stand-alone user interface, in contrast with a mo ...
. ;pyjs Desktop ports :Support for running pyjs apps as pure Python, under
MSHTML Trident (also known as MSHTML) is a proprietary browser engine for the Microsoft Windows version of Internet Explorer, developed by Microsoft. MSHTML debuted with the release of Internet Explorer 4 in 1997. For versions 7 and 8 of Internet Expl ...
(Trident),
Gecko Geckos are small, mostly carnivorous lizards that have a wide distribution, found on every continent except Antarctica. Belonging to the infraorder Gekkota, geckos are found in warm climates throughout the world. They range from . Geckos ar ...
(
XULRunner XULRunner is a discontinued, packaged version of the Mozilla platform to enable standalone desktop application development using XUL, developed by Mozilla. It replaced the ''Gecko Runtime Environment'', a stalled project with a similar purpose. T ...
) or
WebKit WebKit is a browser engine developed by Apple and primarily used in its Safari web browser, as well as on the iOS and iPadOS version of any web browser. WebKit is also used by the BlackBerry Browser, PlayStation consoles beginning from the PS ...
. Pyjs Desktop is conceptually close to GWT "Hosted" mode, except that the applications can be deployed live, under pyjs Desktop, rather than be used exclusively as a debugging tool.


''pyjs Desktop''

The widget set library that comes with pyjs is so similar to
PyQt PyQt is a Python binding of the cross-platform GUI toolkit Qt, implemented as a Python plug-in. PyQt is free software developed by the British firm Riverbank Computing. It is available under similar terms to Qt versions older than 4.5; this mea ...
and
PyGTK PyGTK is a set of Python wrappers for the GTK graphical user interface library. PyGTK is free software and licensed under the LGPL. It is analogous to PyQt/PySide and wxPython, the Python wrappers for Qt and wxWidgets, respectively. Its origi ...
that a port of pyjs was made to run pyjs applications on the desktop, called ''pyjs Desktop'' (formerly ''PyjamasDesktop'' before May 2012 and originally hosted separately prior to version 0.6). The project uses
Webkit WebKit is a browser engine developed by Apple and primarily used in its Safari web browser, as well as on the iOS and iPadOS version of any web browser. WebKit is also used by the BlackBerry Browser, PlayStation consoles beginning from the PS ...
,
XULRunner XULRunner is a discontinued, packaged version of the Mozilla platform to enable standalone desktop application development using XUL, developed by Mozilla. It replaced the ''Gecko Runtime Environment'', a stalled project with a similar purpose. T ...
or
MSHTML Trident (also known as MSHTML) is a proprietary browser engine for the Microsoft Windows version of Internet Explorer, developed by Microsoft. MSHTML debuted with the release of Internet Explorer 4 in 1997. For versions 7 and 8 of Internet Expl ...
as the underlying technology, and it is through these browser engines that pyjs manipulates the DOM model of the application. Together pyjs and pyjs Desktop allow writing cross-platform, cross-desktop, cross-browser and cross-widget applications that run on the web and on the desktop.Pyjamas - Python Applications for Desktop and Web
Luke Kenneth Casson Leighton (August 30, 2008)
Coding in Pyjamas: Apps for Desktop and the Web
Luke Kenneth Casson Leighton (November 7, 2008)


References


Www.google.com links


Pyjs Home
{{DEFAULTSORT:Pyjamas (Software) Free software programmed in Python JavaScript libraries Rich web application frameworks Software using the Apache license Web development software Widget toolkits