简体   繁体   English

如何不执行Jython脚本就检查其语法?

[英]How can I check the syntax of Jython script without executing it?

I'd like to implement python syntax checking in a Java application without and external dependency of the python executable. 我想在没有python可执行文件的外部依赖的Java应用程序中实现python语法检查。

I downloaded the Jython standalone jar and I'm looking for a behavior similar to Python's -m py_compile option. 我下载了Jython独立jar ,正在寻找类似于Python的-m py_compile选项的行为。

Have you tried it? 你试过了吗? Works fine here. 在这里工作正常。

# java -jar jython-standalone-2.7.0.jar -m py_compile run.py && echo 'good'
good

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM