最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

making a python interpreter using javascript - Stack Overflow

programmeradmin0浏览0评论

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 ...

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 ...

Share Improve this question asked Sep 22, 2016 at 6:08 Xiaotao NieXiaotao Nie 611 silver badge3 bronze badges 3
  • Better send script to server side and run python code in a controlled environment. – Ming Commented Sep 22, 2016 at 6:12
  • Your page is on site or just local application? – Artem Selivanov 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... – Xiaotao Nie Commented Sep 22, 2016 at 6:19
Add a ment  | 

3 Answers 3

Reset to default 2

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

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

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.

发布评论

评论列表(0)

  1. 暂无评论