I am beginner to Pyston. I even dont know what I am saying is possible or not. Kindly enlighten me if someone knows can we use Pyston (by Dropbox) to convert python code to LLVM bitcode and then covert that bitcode to Javascript using Emiscripten. Also if I want to create JQuery file. How is that possible to use $ in the Python Code.
As Alan Green pointed out, you can use Transcrypt to have Python 3.5 code cooperate with JQuery. The problem with the dollarsign is solved by using an alias:
__pragma__ ('alias', 'S', '$')
def start ():
def changeColors ():
for div in S__divs:
S (div) .css ({
'color': 'rgb({},{},{})'.format (* [int (256 * Math.random ()) for i in range (3)]),
})
S__divs = S ('div')
changeColors ()
window.setInterval (changeColors, 500)
Transcrypt isn't interpreted into JS but compiled in advance, so it runs as fast as JS.
The HTML is:
<html>
<head>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.0/jquery.min.js"></script>
<script src="__javascript__/jquery_demo.js"; charset="UTF-8"></script>
<script>$ (document) .ready (jquery_demo.start)</script>
</head>
<body bgcolor="black">
<font face="arial" size = "8">
<div>The</div>
<div>quick</div>
<div>brown</div>
<div>fox</div>
<div>jumps</div>
<div>over</div>
<div>the</div>
<div>lazy</div>
<div>dog</div>
</body>
</html>
Disclaimer: I am the initiator of the Transcrypt project.