Return to Snippet

Revision: 14565
at June 6, 2009 16:36 by iloveitaly


Initial Code
def makeNumberFromCharCode(code):
	return (ord(code[0]) << 24) | (ord(code[1]) << 16) | (ord(code[2]) << 8) | ord(code[3])

# In Carbon / Cocoa:
# FourCharCode code = 'abcd'
# In Python:
# code = makeNumberFromCharCode("abcd")

Initial URL
http://www.cocoadev.com/index.pl?FourCharCode

Initial Description
Useful for SBApplication scripting bridge.

Initial Title
Four Char Code From String in Python

Initial Tags
number, python, c, code

Initial Language
Python