Skip to content

Instantly share code, notes, and snippets.

@bradley219

bradley219/tohex.py

Created Nov 5, 2016
Embed
What would you like to do?
#!/usr/bin/env python
import sys
c = sys.stdin.read(1)
while len(c) > 0:
sys.stdout.write("{0:02x}".format(ord(c)))
c = sys.stdin.read(1)
sys.stdout.write("\n")
sys.stdout.flush()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment