Parse a .py file, read the AST, modify it, then write back the modified source code
I want to programmatically edit python source code. Basically I want to read a .py file, generate the AST, and then write back the modified python source code (i.e. another .py file).