On 11Feb2014 19:38, Liam Marsh email@example.com wrote:
do you think it is possible to operate with bytes like with ints? useing the fact than ord('A')==65 ; will it possible to use b'A' like 65 or 00100001, in binary, for example for encryption of files, etc...
In Python 2, b'A' makes a str.
In python 3, b'A' makes a bytes object, and array of small (8-bit) ints.
Element 0 of that array _is_ the byte 65, an integer.
Python 3.3.3 (default, Nov 23 2013, 13:21:35) [GCC 4.2.1 Compatible Apple Clang 4.1 ((tags/Apple/clang-421.11.66))] on darwin Type "help", "copyright", "credits" or "license" for more information.
Just move to python 3 for your code and you'll be better off for what you seem to be wanting.