Debug pajama python code

I use pajamas to create a web page. I am writing python code that translates to javascript on pajamas. Thus, debugging a software error is detected only when testing a web page. It would be much more efficient if we could first run the code in the Python interpreter before compiling into javascript. This seems to require the installation of pajamas-desktop. I tried to install a pajamas-desktop, but for me it was not a direct task, and I could not install a pajamas-desktop.

I am wondering if there is anyway to run the code to just check for errors, that is, I don’t want the widgets to pop up. But it is simply launched in the interpreter to catch errors, such as the absence of a module used in the program to import.

+4
source share
1 answer

Pylint is probably the first place to run - you can install it with easy_install, then run as

$ pylint my_python.py 

Verbosity of errors can be easily edited, but any main problems will be highlighted immediately, and you do not need these additional modules for pajamas - the desktop! Other similar tools (which do the same) are PyCheckMate (syntax checking only), PyChecker and PyFlakes.

+4
source

Source: https://habr.com/ru/post/1347365/


All Articles