My favorites | Sign in
Project Home Downloads Wiki Issues Source
Project Information
Members
Links

Javascript with Python Syntax. No more vestigial memes of braces and brackets littering your code.

For example:

  var el = document.getElementById("string")
  for var i=0; i<5; i++: el.innerHTML += "hello! "
  
  var count = 0
  for var i=0; i<5; i++:
    count += 1
    if count==2:
      count *= 5
  
  document.getElementById("count").innerHTML = count;    
  
  function triangle(a,b):
    function sqroot(x): return Math.pow(x,.5)
    return sqroot( a*a + b*b )
  
  document.getElementById("triangle").innerHTML = triangle(3,4);

How to Use

  1. Include pyscript.min.js in your head tag.
  2. Put any pyscript code in a <script type="text/pyscript"> ... </script> block
  3. You are done

In Action

  1. See the demo here.
  2. Run the unit tests

TODO

Lots of edge cases. This was done as a proof-of-concept. I'm looking for folks who want to run with it.

Powered by Google Project Hosting