开发者

Debugging pyjamas python code

I am using pyjamas to develop a web page. I write python code which is translated to javascript by pyjamas. This way debugging programming error is caught only when testing the web page. It would be much more efficient if we can run the code first in the Python interpreter before compiling to javascript. This seems would require pyjamas-desktop be installed. I tried installing pyjamas-desktop but it was not straight forward for me and I could not succeed in installing pyjamas-desktop.

I am wondering if there is anyway to run the code to just check for error开发者_如何学编程s i.e. I do not want to see the widgets popped up. But just running in the interpreter so that errors like missing to import a module that is used in the program are caught.


Pylint is probably the first place to start - it can be installed with easy_install then run as

$ pylint my_python.py

The verbosity of errors can be easily edited - but any major problems will be highlighted immediately - and you don't need those extra pyjamas-desktop modules installed! Other similar tools (that do the same sort of thing) are PyCheckMate (syntax check only), PyChecker, and PyFlakes.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜