Вопрос

In python we can use the following:

symtable.symtable(code,file,compile type)

But is it possible to get a symtable object a current executable code?

Это было полезно?

Решение

The executable code itself carries that information. See the inspect module documentation, but code objects have co_names and co_varnames, for example.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top