Python: get int value from a char string
Question: This is one of those silly questions and I don't really know how to formulate
it, so I'll give an example. I got

    
    
    v = chr(0xae) + chr(0xae)
    

where #AEAE is, in decimal, the value of 44718.

My question is how I get the integer value of `v`? I know about `ord()` but I
can use it only for a char, and not for a string.

Thank you.


Answer: I managed to do this using the `struct` module:

    
    
    import struct
    int_no = struct.unpack('>H', v)[0]
    print int_no
    

which outputs the desired results:

    
    
    44718
    

