Created
May 1, 2012 06:53
-
-
Save grissiom/2565746 to your computer and use it in GitHub Desktop.
python darkart
This file contains hidden or 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
# get the source file path in a robust way | |
# from http://stackoverflow.com/a/6098238/297347 | |
# with a little cleanup | |
import inspect | |
script_patch = os.path.abspath(os.path.dirname(inspect.getfile(inspect.currentframe()))) | |
# convert a binary stream into hex format | |
# Note: hex will take integer as argument | |
print ''.join(['%02x' % i for in in stream]) | |
# thus, convert 0x1234 to 1234 can be | |
print int(''.join(['%02x' % i for i in hex_num])) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment