#!/usr/bin/env python3 # -*- coding: utf-8 -*- #author:wq 2016-4-13 n1 = 255 n2 = 1000 x = hex(255) y = hex(1000) print(x) print(y) print(hex(n1),hex(n2))
[root@CentOS7 script]# python hex.py 0xff 0x3e8 0xff 0x3e8