Js2Py icon indicating copy to clipboard operation
Js2Py copied to clipboard

JavaScript to Python Translator & JavaScript interpreter written in 100% pure Python🚀 Try it online:

Results 140 Js2Py issues
Sort by recently updated
recently updated
newest added

Hey hey hey, I need this function for my project, so I just added it. If you have some ideas to improve it, let me know :D

Hello! This code gives me an error. ``` import js2py def main(): context = js2py.EvalJs(enable_require=True) context.execute("var fontkit = require('fontkit');") if __name__ == '__main__': main() ``` ``` File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/js2py/evaljs.py", line 199,...

Hello. There is a typo in Py to JsPy converter function Js(). It creates PyJsUint16Array instead of PyJsUint32Array.

in js,function.toString() can get function code ![image](https://user-images.githubusercontent.com/32086491/203948345-b0e187bd-63ab-4f27-838f-1027773d8764.png) in my,i need get function local var , so what should i do? thanks

Traceback (most recent call last): File "D:\Study\Homework\py\scrape\hm\guojiayaojianju.py", line 46, in print(context.get_request_payload()) File "D:\fsy\Anaconda3\lib\site-packages\js2py\base.py", line 1203, in __call__ return to_python(parent._obj.callprop(meth, *args)) File "D:\fsy\Anaconda3\lib\site-packages\js2py\base.py", line 996, in callprop return cand.call(self, args) File...

Here is the test code and functioning equivalent: js2py.eval_js('''console.log(eval('('+function(){return "works!"}+')')())''') js2py.eval_js('''console.log(eval((function(){return "works!"}))())''') Still trying to find this in the spec and understand what's missing, from what I gather js2py can't...

enhancement

When importing js2py. Traceback (most recent call last): File "C:\...\Python312\site-packages\js2py\utils\injector.py", line 121, in append_arguments arg = name_translations[inst.arg] ~~~~~~~~~~~~~~~~~^^^^^^^^^^ KeyError: 3 Then I use Python Debugger : Exception has occurred: NameError...

**Description:** I encountered a `KeyError` while trying to use `pipwin` to install the `pyppf` package. The error seems to originate from the `js2py` package, specifically in the `append_arguments` function of...

Hello! After doing `buffer = require("buffer").Buffer` to get the buffer from the buffer module, i need to access the `from` method, but it's impossible due to the from builtin in...