mattpap / py2js Goto Github PK
View Code? Open in Web Editor NEWPython to JavaScript translator
Home Page: http://mattpap.github.com/py2js/html/
License: MIT License
Python to JavaScript translator
Home Page: http://mattpap.github.com/py2js/html/
License: MIT License
Making py2js setup.py installable would make it easier to try out deploy etc.
Like in:
a[3, 4] = [5]
it should returns a tuple, not an array
make it look nice in the output and write tests
put everything in namespaces
We need to implement those in the defs.js first and then improve the translator
Like
form math import sqrt
implement _args, *_kwargs, default arguments
E.g. this fails:
"""
Returns True if "e1" intersects any edge from "edges".
"""
because it produces this:
a.js:159: SyntaxError: missing ; before statement:
a.js:159: "\n" + " Returns True if "e1" intersects any edge from "edges".\n" + " ";
a.js:159: .................................^
js> t = list([tuple([0, 1]), tuple([1, 2])])
[(0, 1), (1, 2)]
js> t
[(0, 1), (1, 2)]
js> t1 = tuple([1, 2])
(1, 2)
js> t1
(1, 2)
js> t.index(t1)
uncaught exception: ValueError: list.index(x): x not in list
and the problem is that:
js> t1 == t1
true
js> t1 == tuple([1, 2])
false
the last statement should return true
I think line 289 should be
return parseInt(value);
And make sure it works nice for the builtin types
call extjs js files over the web, make it a nice example with a menu bar, some call backs and drawing canvas, all in python.
Hi, I have a problem with generated code failing with TypeErrors.
The problem while processing a string, when I try to do the following operations:
s = "Test String"
s = s.replace("Test", "New Test")
s.find("Test") # TypeError: s.find is not a function
I don't know much about javascript, but it looks to me that this is because _str.prototype.replace in py-builtins.js doesn't wrap it's result in str before returning it.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.