GitHub - flexxui/pscript: Python to JavaScript compiler | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

flexxui/pscript

Repository files navigation

PScript

Build Status Documentation Status

PScript is a Python to JavaScript compiler, and is also the name of the subset of Python that this compiler supports. It was originally developed as a part of Flexx and is now a project on its own.

Installation

PScript is pure Python and requires Python 3.6+ (including Pypy). It has no further dependencies.

pip install pscript

Short example

   from pscript import py2js

   def foo(a, b=2):
      print(a - b)

   print(py2js(foo))

Gives:

   var foo;
   foo = function flx_foo (a, b) {
      b = (b === undefined) ? 2: b;
      console.log((a - b));
      return null;
   };

Supported browsers

PScript aims to support all modern browsers, including Firefox, Chrome and Edge. Internet Explorer is in principal supported from version 9, though some constructs (e.g. async and await) do not work in Internet Explorer.

PScript in the wild

To give an idea of what PScript can do, here are some examples in the wild:

  • Obviously, everything built in Flexx uses PScript, see e.g. these examples
  • The front-end of TimeTagger.app is built in Python using PScript.

Let us know if you know more!

License

PScript makes use of the liberal 2-clause BSD license. See LICENSE for details.

About

Python to JavaScript compiler

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 26

Languages

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.