| | |
Decimal to Hexadecimal
![]() |
When I run:
I get 0xff, but I like to get just 'ff'
Python Syntax (Toggle Plain Text)
dec = 255 print hex(dec)
•
•
Join Date: Sep 2005
Posts: 133
Reputation:
Solved Threads: 58
This should do what you want:
Python Syntax (Toggle Plain Text)
print "%x" % 255
•
•
Join Date: Apr 2006
Posts: 148
Reputation:
Solved Threads: 40
•
•
•
•
When I run:
I get 0xff, but I like to get just 'ff'Python Syntax (Toggle Plain Text)
dec = 255 print hex(dec)
![]() |
Similar Threads
- hexadecimal convertions (C#)
- copy string and convert to upper case (Assembly)
- Anyone can help?? (C++)
- pls help me to convert char to integer. (C)
- hop over decimal and straight to business (C++)
Other Threads in the Python Forum
- Previous Thread: Module apihelper
- Next Thread: collecting ip address
| Thread Tools | Search this Thread |
address alarm anydbm app beginner cipher conversion coordinates curves cx-freeze data development dictionary directory dynamic examples excel feet file float format function generator getvalue gui halp handling homework images import input ip itunes java keycontrol line linux list lists loan loop maintain maze millimeter mouse mysqldb number numbers output parsing path port prime programming projects py2exe pygame pyglet pymailer python queue random recursion recursive screensaverloopinactive script scrolledtext searchingfile shebang slicenotation split ssh string strings table terminal text thread threading time tlapse tooltip tuple tutorial type ubuntu unicode url urllib urllib2 variable variables ventrilo verify vigenere web webservice wx.wizard wxpython xlwt






