Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • DisModule in Python

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 197
    Comment on it

    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)

Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: