문제

I have a .pyc file with no corresponding Python source code. I want to see the disassembly of the module using dis. I can import my module just fine with

import dis
import foo

But to call dis.dis on it, I can't use the module object. I need the corresponding code object which backs foo. How do I create it? It seems that the compile builtin can compile strings, classes, methods, and functions, but not files or modules.

How do I generate this code object given what I have?

도움이 되었습니까?
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top