Python to JavaScript compiler.
Project description
PScript
========
.. image:: https://travis-ci.org/flexxui/pscript.svg
:target: https://travis-ci.org/flexxui/pscript
.. image:: https://readthedocs.org/projects/pscript/badge/?version=latest
:target: https://pscript.readthedocs.org
PScript is a Python to JavaScript compiler, and is also the name of the subset
of Python that this compiler supports. It was developed as a part of
`Flexx <http://flexx.live>`_ (as `flexx.pyscript`) and is now represented
by its own project. Although it is still an important part of Flexx, it can
also be useful by itself.
Installation
------------
PScript is pure Python and requires Python 2.7 or 3.5+ (including Pypy).
It has no further dependencies.
* ``conda install pscript -c conda-forge``, or
* ``pip install pscript``
Short example
-------------
```py
from pscript import py2js
def foo(a, b=2):
print(a - b)
print(py2js(foo))
```
Gives:
```js
var foo;
foo = function flx_foo (a, b) {
b = (b === undefined) ? 2: b;
console.log((a - b));
return null;
};
```
License
-------
PScript makes use of the liberal 2-clause BSD license. See LICENSE for details.
========
.. image:: https://travis-ci.org/flexxui/pscript.svg
:target: https://travis-ci.org/flexxui/pscript
.. image:: https://readthedocs.org/projects/pscript/badge/?version=latest
:target: https://pscript.readthedocs.org
PScript is a Python to JavaScript compiler, and is also the name of the subset
of Python that this compiler supports. It was developed as a part of
`Flexx <http://flexx.live>`_ (as `flexx.pyscript`) and is now represented
by its own project. Although it is still an important part of Flexx, it can
also be useful by itself.
Installation
------------
PScript is pure Python and requires Python 2.7 or 3.5+ (including Pypy).
It has no further dependencies.
* ``conda install pscript -c conda-forge``, or
* ``pip install pscript``
Short example
-------------
```py
from pscript import py2js
def foo(a, b=2):
print(a - b)
print(py2js(foo))
```
Gives:
```js
var foo;
foo = function flx_foo (a, b) {
b = (b === undefined) ? 2: b;
console.log((a - b));
return null;
};
```
License
-------
PScript makes use of the liberal 2-clause BSD license. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pscript-0.5.5.tar.gz
(123.1 kB
view details)
File details
Details for the file pscript-0.5.5.tar.gz
.
File metadata
- Download URL: pscript-0.5.5.tar.gz
- Upload date:
- Size: 123.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce6df0e9bbd92e630cf35a9e65d1f4d16a69bb28b1366e9d7de5220a7e3232ae |
|
MD5 | d13c635cac73cd53a014f17fc1d914ec |
|
BLAKE2b-256 | ef0bd7ae035fb9066c15743982877a3622c5d59f9caec16a1d8e11b8d0aa178e |