Skip to content

Instantly share code, notes, and snippets.

@cwvh
Created November 2, 2013 17:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwvh/7281488 to your computer and use it in GitHub Desktop.
Save cwvh/7281488 to your computer and use it in GitHub Desktop.
stack = []
for line in sys.stdin:
dec = int('0b' + line, 2)
signed = struct.unpack('=l', struct.pack('=L', dec & 0xffffffff))[0]
stack.append(signed)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment