How to decrypt a columnar transposition cipher
I figured it out. Once you know the number of rows and columns, you can write the ciphertext into the rows, then permute the rows according to the key. Please correct if my explanation is wrong.  The plain text is "execlent work you have cracked the code"
My question is not one of coding per say, but of understanding the algorithm. 
Conceptually I understand how the column transposition deciphers text with a constant key value for example 10.
My confusion occurs, when the key is a permutation. For example key = [2,4,6,8,10,1,3,5,7,9] and a message like "XOV EK HLYR NUCO HEEEWADCRETL CEEOACT KD". The part where I'm confused is writing the cipher text into rows, then permuting the row according to the key. 
Can someone please provide some clarification on this.