Ask coding questions

← Back to all posts
is there any way for python to read node.js?
Isqne (0)

i want to make a bot in python with javascript commands and functions, but i want to make it as compact as possible is there how i can somehow make python interpret the javascript?

Answered by Kai_Justice (271) [earned 5 cycles]
View Answer
Isqne (0)
Kai_Justice (271)

This might be what you're looking for. Although I suggest writing it in one language rather than two, as it may lead to more problems.

Isqne (0)

@Kai_Justice Hm, I'll give you a read, thanks

Yimmee (10)

Make a JavaScript interpreter in py

Isqne (0)

@Yimmee Yes, but how? I wanted to do it in a simple way, and I'm a junior in programming

Coder100 (18882)

You could use the system command to execute the js file, but do note that would prevent your python file from running until the js file terminates.

import os
os.system("node <script>")

replace <script> with the actual file!

Isqne (0)

@Coder100 Thanks, I think this might help.