I can't tell you why that one-liner isn't working, but you can try http://www.cassandraring.com for generating balanced tokens.

On Thu, Oct 31, 2013 at 11:59 PM, Techy Teck <comptechgeeky@gmail.com> wrote:
I am trying to setup two node Cassandra Cluster on windows machine. I have basically two windows machine and I was following this datastax tutorial (http://www.datastax.com/2012/01/how-to-setup-and-monitor-a-multi-node-cassandra-cluster-on-windows)

Whenever I use the below command to get the token number from the above tutorial -

    python -c "num=2; print ""\n"".join([(""token %d: %d"" %(i,(i*(2**127)/num))) for i in range(0,num)])"

I always get this error -

    C:\Users\username>python -c "num=2; print ""\n"".join([(""token %d: %d"" %(i,(i*(2**127)/num))) for i
    in range(0,num)])"
      File "<string>", line 1
        num=2; print "\n".join([("token %d: %d" %(i,(i*(2**127)/num))) for i in range(0,num)])
    SyntaxError: invalid syntax