static int BinarySearch(int[] A, int n, int x)
{
int left_bound = 0, right_bound = n, q;
while(left_bound != right_bound)
{
q = (left_bound + right_bound) >> 1;
if(A[q] == x)
return q;
else if(A[q] > x)
right_bound = q;
else
left_bound = q;
}
return -1;
}
cryptography is a package designed to expose cryptographic recipes and primitives to Python developers. Our goal is for it to be your "cryptographic standard library". It supports Python 2.6-2.7, Python 3.2+, and PyPy.
PyCrypto is written and tested using Python version 2.1 through 3.3. Python 1.5.2 is not supported.
import os
print os.getenv("SystemDrive")