Hi all,
I am trying convert IP addresses form Decimal format [Like 192.168.12.13] to HEX format [c0 a8 9d 80].
For Example the IP "192.168.157.128" is equivalent to "c0 a8 9d 80" in HEX.
How to do that.??
debasishgang7
0
Junior Poster in Training
Recommended Answers
Jump to PostOne way.
>>> ip = "192.168.157.128" >>> ip = ip.split('.') >>> ' '.join((hex(int(i))[2:] for i in ip)) 'c0 a8 9d 80' >>>
All 2 Replies
snippsat
661
Master Poster
debasishgang7
commented:
It helped me alot...
+3
debasishgang7
0
Junior Poster in Training
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.