Dis module is the Python disassembler. It is used to converts byte codes to a format that is slightly more appropriate for human consumption and python function.
And we can run the disassembler from the command line. It can use to compiles the given script and prints the disassembled byte codes to the STDOUT. And we can also use dis as a module. The dis function takes a class, method, function or code object as its single argument and variable to all function. For example you can see below code for dis module.
#!/shiva/bin/python
import dis
def sum():
r1 = 10
r2 = 20
sum = r1 + r2
print "r1 + r2 = %d" % sum
# Call dis function for the function.
dis.dis(sum)
0 Comment(s)