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