Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 
  • How to use the dis Module in python

    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 0
    • 335
    Comment on it

    In python dis module converts byte codes to a format and You can run the disassembler from the command line and It compiles the given script and prints the disassembled byte codes to the stdout . The dis function takes a class, method, function or code object in single argument.
    use dis module show in given below as example,
    EXAMPLE:

    import dis
    
    def sum():
       var1 = 30
       var2 = 40
    
       sum = var1 + var2
       print "var1 + var2 = %d" % sum
    
    # use and  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: