Created
November 7, 2017 09:51
-
-
Save neoplacer/bf0878e38fd9bed1226a6e85409fcd2f to your computer and use it in GitHub Desktop.
Text to Hex converter
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Text to Hex converter by Richard Gericke | |
# Decode any Text from Clipboard to html %hex | |
# an copy it back to clipboard_append | |
print "Text to HTML Hex converter" | |
print "Version 1.0" | |
print "(C) Richard Gericke" | |
print "" | |
from Tkinter import Tk | |
r = Tk() | |
r.withdraw() | |
str = r.clipboard_get() | |
r.clipboard_clear() | |
c = str.encode('utf-8').encode('hex') | |
d = list(c) | |
a = u"" | |
b = 1 | |
for n in d: | |
b+=1 | |
if b==2: | |
a+=u"%"+n | |
b=0 | |
else: | |
a+=n | |
print a | |
r.clipboard_append(a) | |
r.destroy() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment