开发者

Python Code Introspection and Analysis

I am trying to write a Python code analyzer, and I am trying to avoid having to parse bare Python text files. I was hoping that once the Python compiler/interpreter parses the code there's a way to get to the object code or parse tree from within a running Python program.

Is there anyway to do this?

Thank yo开发者_C百科u


A combination of ast and tokenize should provide the necessary framework for what you want to do.


You can take a look at Python's abstract syntax trees.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜