Skip to main content

Python to JavaScript compiler.

Project description

PScript
========

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


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.2.tar.gz (107.7 kB view details)

Uploaded Source

File details

Details for the file pscript-0.5.2.tar.gz.

File metadata

  • Download URL: pscript-0.5.2.tar.gz
  • Upload date:
  • Size: 107.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for pscript-0.5.2.tar.gz
Algorithm Hash digest
SHA256 76e8d5e23d98770f89f991ea296dd758ece0fe039c89ae2d1c6905e0733071e2
MD5 d25105850024ad73d7511dc59d1d7aa6
BLAKE2b-256 3f5ff9e5fd938d9b195d70e5f2adf454bf8f84822a773a8d5e8140912ccb9365

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page