1

I want to make a python interpreter by using Javascript.

Then you can input the python code and the Javascript in the webpage can interpret the code into javascript code and then run the code and return the result.

Because I have not much experience in this area, so I want some advice from the senior.

Thanks very much ...

3
  • Better send script to server side and run python code in a controlled environment. Commented Sep 22, 2016 at 6:12
  • Your page is on site or just local application? Commented Sep 22, 2016 at 6:15
  • It is a good idea, but i want to use javascript itself to interpret the python code...just like some project in github which uses javascript to interpret the javascript... Commented Sep 22, 2016 at 6:19

3 Answers 3

2

There are many interpreters and source-to-source compilers that can convert Python to JavaScript. The Skulpt interpreter allows Python source code to run in a web browser on the client-side.

Sign up to request clarification or add additional context in comments.

Comments

2

You can use pypyjs, and the detailed procedure is also available.

1 Comment

The most recent release for this project is dated July 2015 and its github hasn't had any code commits for 6 years. Its Readme suggests to go to Pyodide link which is currently active.
1

Well, an interpreter is not really a job for a beginner, also you'd better send the code to server side with AJAX, and then display the result in the page.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.