You can also use Js2Py which is written in pure python and is able to both execute and translate javascript to python. Supports virtually whole JavaScript even labels, getters, setters and other rarely used features.

import js2py

js = """
function escramble_758(){
var a,b,c
a='+1 '
b='84-'
a+='425-'
b+='7450'
c='9'
document.write(a+c+b)
}
escramble_758()
""".replace("document.write", "return ")

result = js2py.eval_js(js)  # executing JavaScript and converting the result to python string 

Advantages of Js2Py include portability and extremely easy integration with python (since basically JavaScript is being translated to python).

To install:

pip install js2py
Answer from Piotr Dabkowski on Stack Overflow
🌐
GitHub
github.com › PythonJS › PythonJS
GitHub - PythonJS/PythonJS: PythonJS development has moved to Rusthon · GitHub
PythonJS is a transpiler written in Python that converts a python like language into fast JavaScript.
Starred by 880 users
Forked by 94 users
Languages   Python 76.0% | JavaScript 17.1% | Perl 6.9%
🌐
Pyjs
pyjs.org
Pyjs
pyjs is a Rich Internet Application (RIA) Development Platform for both Web and Desktop. With pyjs you can write your JavaScript-powered web applications entirely in Python.
🌐
Transcrypt
transcrypt.org
Transcrypt - Python in the browser - Lean, fast, open!
You'll always have immediate access to the newest JavaScript libraries, use the newest DOM functions, interact with the newest HTML or CSS. Calling JavaScript functions from Python, embedding JavaScript code in your Python source, attaching Python event handlers to DOM elements, passing native data between Python and JavaScript, it all happens without any conversion or special syntax.
🌐
DEV Community
dev.to › willp › call-javascript-code-in-python-551a
Call JavaScript Code in Python - DEV Community
August 24, 2023 - This article introduces the usage of PythonMonkey, a new Python library for running JavaScript code in Python easily and efficiently.
🌐
PyPI
pypi.org › project › Python.js
Python.js - PyJS
JavaScript is disabled in your browser · Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
Halo Lab
halo-lab.com › blog › how-to-run-a-python-script-from-node-js
How to Run a Python script from Node.js | Halo Lab
April 12, 2023 - FROM nikolaik/python-nodejs:latest as development WORKDIR /usr/src/app RUN pip install scikit-learn numpy pandas simplejson COPY ./package.json ./yarn.lock ./ RUN yarn RUN yarn install COPY ./ ./ RUN yarn build ENV PORT 4000 EXPOSE $PORT # Production mode FROM nikolaik/python-nodejs:latest as production RUN pip install scikit-learn numpy pandas simplejson ARG NODE_ENV=production ENV NODE_ENV=${NODE_ENV} WORKDIR /usr/src/app COPY --from=development /usr/src/app ./ ENV PORT 4000 EXPOSE $PORT CMD ["node", "dist/main"]
🌐
Full Stack Python
fullstackpython.com › javascript.html
JavaScript - Full Stack Python
Learn JS data teaches how to manipulate ... Node.js. A Beginner's Guide to JavaScript's Prototype explains the fundamentals of JavaScript's object system, which is a prototype-based model and different from many other common programming languages' object models. Understanding Data Types in JavaScript examines JavaScript's dynamic data type model and how it manifests in the way numbers, string, Booleans and arrays are used. Create a simple HTML file with basic elements in it. Use the python -m ...
Find elsewhere
🌐
GitHub
github.com › PiotrDabkowski › Js2Py
GitHub - PiotrDabkowski/Js2Py: JavaScript to Python Translator & JavaScript interpreter written in 100% pure Python🚀 Try it online:
JavaScript 6 support was achieved by using Js2Py to translate javascript library called Babel. Babel translates JS 6 to JS 5 and afterwards Js2Py translates JS 5 to Python.
Starred by 2.6K users
Forked by 278 users
Languages   JavaScript 65.1% | Python 34.9%
🌐
CodeOp
codeop.tech › how-to-run-python-code-in-javascript-a-beginners-guide
How to Run Python Code in JavaScript? - A Beginner's Guide
Language selection significantly ... make it a popular first language for general software learning. JavaScript enables immediate visible results through web development, motivating visual learners....
🌐
PyPI
pypi.org › project › javascript
javascript
JavaScript is disabled in your browser. Please enable JavaScript to proceed · A required part of this site couldn’t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
🌐
GeeksforGeeks
geeksforgeeks.org › python › difference-between-python-and-javascript
Difference between Python and JavaScript - GeeksforGeeks
July 12, 2025 - Python emphasizes readability and simplicity, ideal for tasks like data analysis and backend development, while JavaScript is primarily used for web development, offering dynamic and interactive functionality directly in web browsers.
🌐
Real Python
realpython.com › python-vs-javascript
Python vs JavaScript for Pythonistas – Real Python
July 31, 2023 - You can also choose from multiple Python distributions, such as Anaconda, that come with preinstalled third-party packages. JavaScript is different. There’s no stand-alone program to download. Instead, every major web browser ships with some kind of JavaScript engine and an API, which together make the runtime environment. In the previous section, you learned about Node.js, which allows for running JavaScript code outside of the browser.
🌐
Bacancy Technology
bacancytechnology.com › bacancy technology › blog › technology comparison
Python vs JavaScript: The Ultimate Language Comparison
1 month ago - Python is ideal for parallel computing, enabling more efficient use of resources and faster code execution. JavaScript is dynamic and handles large numbers of requests and concurrent users.
🌐
freeCodeCamp
freecodecamp.org › news › learn-python-for-javascript-developers-handbook
How to Learn Python for JavaScript Developers [Full Handbook]
November 22, 2024 - Over the years, JavaScript has evolved significantly and is now used on the server side (thanks to Node.js) and in a variety of application environments beyond the browser. JavaScript is event-driven, and it’s often praised for its versatility and asynchronous capabilities, which are essential for building modern, responsive web applications. Python, on the other hand, was developed with a focus on simplicity and readability.
🌐
Medium
medium.com › @willkantorpringle › pythonmonkey-javascript-wasm-interop-in-python-using-spidermonkey-bindings-4a8efce2e598
PythonMonkey: JavaScript/WASM Interop in Python using SpiderMonkey Bindings
August 24, 2023 - PythonMonkey will allow developers to easily port their JavaScript libraries to Python, without suffering the costly burden of rewriting their libraries in Python and maintaining the ports. JavaScript is also ideal for highly asynchronous work loads, whereas Python is not. At Distributive, we intend to use this library to execute our complex dcp-client library, which is written in JS, and enables distributed computing on the web stack.
🌐
CodeConvert AI
codeconvert.ai › python-to-javascript-converter
Free Python to JavaScript Converter — AI Code Translation | CodeConvert AI
This free online converter lets you convert code from Python to JavaScript in a click of a button.
🌐
Medium
medium.com › @ugo-codes › unlocking-cross-language-magic-how-to-run-javascript-functions-from-python-64894ab73935
Unlocking Cross-Language Magic: How to Run JavaScript Functions from Python | by Ikedinma Ugochukwu | Medium
October 26, 2023 - In the picture above we created a new file called higherFunction.js, in this file we just created a function that takes in another function and a user age as a parameter, it then calls the function (that was passed in as a parameter) passing in the current year and the user age so that the function can do whatever it wants with the current year and the user’s age. Let’s then create a function in python that receives the current year and the user’s age so that we’ll be able to compute the year when the user was born.
🌐
GeeksforGeeks
geeksforgeeks.org › javascript › how-to-run-javascript-from-python
How to Run JavaScript from Python ? - GeeksforGeeks
April 6, 2023 - In this article, we'll discuss how to run a javascript file with Python. For this, we'll use the JS2PY(Javascript Runtime in Pure Python) Python module. JS2PY works by translating JavaScript directly into Python.