Advertisement
rfmonk

array_string.py

Jan 12th, 2014
117
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.18 KB | None | 0 0
  1. #!/usr/bin/env python
  2.  
  3.  
  4. import array
  5. import binascii
  6.  
  7. s = 'This is the array.'
  8. a = array.array('c', s)
  9.  
  10. print 'As string:', s
  11. print 'As array :', a
  12. print 'As hex   :', binascii.hexlify(a)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement