SciPy provides the scipy.cluster.vq module for k-means clustering.
Here's an example:
from scipy.cluster.vq import kmeans, vq
data = ... # Your data as a numpy array
k = 3 # Number of clusters
centroids, _ = kmeans(data, k)
cluster_assignment, _ = vq(data, centroids)