meta 0.1.2

Оценок пока нет — будьте первым

Описание

meta is a pure Python module containing a framework to manipulate and analyze Python ast's and bytecode. Example This shows how to take python source to a code object and back again from within python: import meta, ast source = ''' a = 1 b = 2 c = (a ** b) ''' mod = ast.parse(source, '', 'exec') code = compile(mod, '', 'exec') mod2 = meta.decompile(code) source2 = meta.dump_python_source(mod2) assert source == source2 This shows the depyc script. The script compiles itself, and then the compiled script extracts itself: DEPYC_FILE=`python -c"import meta.scripts.depyc; print meta.scripts.depyc.__file__"` depyc $DEPYC_FILE --pyc > depycX.pyc python -m depycX depycX.pyc --python > depycX.py echo depycX.py Notes - Meta is python3 compliant (mostly) Testing python -m unittest discover meta Requirements:

Информация о программе

  • Категория: Другое
  • ОС: Linux
  • Скачиваний: 0
Скачать