hex()
十六进制转十进制函数
oct()
八进制转十进制函数
ord
返回ascii字符数值
示例
hex/oct处理对象需要用单引号或双引号包围
print hex("0xff"),"\n";
print hex(0xff),"\n"; #incorrect result
print oct("055"),"\n";
print oct(055),"\n"; #incorrect result
print ord("a"),"\n";
print ord(a),"\n";
原文:https://www.cnblogs.com/movit/p/14924686.html