Possible Duplicate:
RGB Int to RGB – Python
Using Python I need to convert an int to a six digit hex that I can use as a background colour in CSS. Any ideas how to do that?
The int is a primary key of a model in Django.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Convert an int to a 6-digit hex:
Check that the hex is equivalent to the int: