>>> '0x' + hex(543)[2:].zfill(5)
'0x0021f'

this is a good way but it's still in string format. but if i convert it to 
long, then the leading 0s will be truncated. i guess can't have it both way. 
 
 
 

 
 

_______________________________________________ Tutor maillist - 
[email protected] To unsubscribe or change subscription options: 
http://mail.python.org/mailman/listinfo/tutor                                   
 
_______________________________________________
Tutor maillist  -  [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor

Reply via email to