1

What I am trying to develop is a web-environment app which will let user write and syntax check his own python code. To the moment, I have embedded ACE editor to my app using the python mode. My problem is that ace does not include a javascript lib for python syntax check in order to implement it by using workers as described here How to integrate syntax check in Ace Editor using custom mode?.

Through my search I have found modules like pyflakes or pylint. for syntax check which are both written in python. The options of using an online checker, or connecting to the server in order to execute the check do not work for me since the scenario of my app is to provide python syntax check (even without internet connection) while writing on ace.

So, what I am asking is if there is a syntax checker for python that could be used along with a web embedded ace editor?

Thanks

1 Answers1

1

https://github.com/ajaxorg/ace/pull/1174 may be somewhat helpful, as it has python2 lexer compiled to javascript with emscripten, and can show basic errors.

It may be possible to create a more full featured version by compiling pylint to javascript, but all python->js compilers i know are too limited, and compiling whole python to webassembly may result in too big bundle.

a user
  • 23,300
  • 6
  • 58
  • 90
  • Thank you for taking the time to answer. I found helpful the link given on the answer of this post https://stackoverflow.com/questions/30155551/python-in-browser-how-to-choose-between-brython-pypy-js-skulpt-and-transcrypt It compares modules that compile python to javascript on web browser like empythoned which is used on the link you mention. I am trying to use skulpt to implement my scenario though there seem to be some limitations on the python modules that get recognized by skulpt. – N.Papadopoulos Feb 12 '19 at 11:36