Questions tagged [python-ast]

The ast module helps Python applications to process trees of the Python abstract syntax grammar.

19 questions
0
votes
0 answers

OSError: dlopen(libclang.dylib, 6): image not found

My python code: from clang.cindex import Index, CursorKind Error thrown: Traceback (most recent call last): File "/Users/sibillalazzerini/.pyenv/versions/3.8.0/lib/python3.8/site-packages/clang/cindex.py", line 4174, in get_cindex_library …
0
votes
1 answer

Python reconstruct function from AST, default parameters

I am attempting to implement a decorator that receives a function, parses it into an AST, eventually will do something to the AST, then reconstruct the original (or modified) function from the AST and return it. My current approach is, once I have…
user2649681
  • 750
  • 1
  • 6
  • 23
0
votes
2 answers

How to access a docstring from a separate script?

Building a GUI for users to select Python scripts they want to run. Each script has its own docstring explaining inputs and outputs for the script. I want to display that information in the UI once they've highlighted the script, but not selected to…
e4862
  • 19
  • 6
0
votes
1 answer

Python AST - merging two ASTs

Do you have any idea how can i merge two asts using python ast? I would like to do something like this: n1 = ast.parse(input_a) n2 = ast.parse(input_b) n = merge(n1,n2) I would like create root n with childs n1 and n2. Thanks in advance
Kapucko
  • 343
  • 3
  • 11
1
2