def main():
import optparse
parser = optparse.OptionParser(__doc__.strip())
opts, args = parser.parse_args()
if not args:
parser.error("You need to specify the name of Python files to print out.")
import compiler, traceback
for fn in args:
print_('\n\n%s:\n' % fn)
try:
printAst(compiler.parseFile(fn), initlevel=1)
except SyntaxError:
_, e, _ = sys.exc_info()
traceback.print_exc()
评论列表
文章目录