hexch 338 B

12345678910111213141516
  1. #!/usr/bin/env python3
  2. import argparse
  3. def _hexip(ip: str):
  4. parts = [int(p) for p in ip.split(".")]
  5. return ''.join("{:02x}".format(p) for p in parts)
  6. if __name__ == "__main__":
  7. parser = argparse.ArgumentParser("webchat IP hexlify")
  8. parser.add_argument("ip")
  9. args = parser.parse_args()
  10. print(_hexip(args.ip))