Search code examples
pythongocode-conversion

How to parse *.py file with python?


I'd like to parse Python source in order to try making a basic source code converter from Python to Go.

  • What module should I use?
  • Should I proceed or not?
  • If I should proceed, how?

Solution

  • Have a look at the language services packages, particularly the ast.

    My guess is that if you don't already have a solid grasp of both parsing as well as code generation techniques, this is going to be a difficult project to undertake.

    good luck!