python spaces error
I'm just fed up from python codes and spaces can any one help me in this code spaces!!

    enter code here

import sys
from threading import Thread
import socket
import MySQLdb

allClients=[]

class Client(Thread):
    
    def __init__(self,clientSocket):
                Thread.__init__(self)
                self.sockfd = clientSocket #socket client
                self.name = ""
                self.nickName = ""

    def newClientConnect(self):
         
      allClients.append(self.sockfd)
while True:  
#while True:
      try:
             rm= self.sockfd.recv(2048)
             print rm
             
             def run(self):
                self.newClientConnect()
                while True:
                        buff = self.sockfd.recv(2048)
                        if buff.strip() == 'quit':
                             self.sockfd.close()
                            break # Exit when break
                            else:
self.sendAll(buff)
                    
                    
if __name__ == "__main__": 

    #Server Connection to socket:
    IP = '10.0.2.2'
    PORT = 5807
    serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    serversocket.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, 1 )
    print ("Server Started")
    try:
        serversocket.bind(('',54638))
    except ValueError,e:
        print e
    serversocket.listen(5)


    db= MySQLdb.connect(host= "localhost",
                  user="root",
                  passwd="newpassword",
                  db="new_schema")
#setup cursor
cursor = db.cursor()
#create anooog1 table
cursor.execute("DROP TABLE IF EXISTS try")
#sql = """CREATE TABLE game (COL1 INT, COL2 INT, PRIMARY KEY (COL1))"""
sql="""CREATE TABLE try (COL1 VARCHAR(45), COL2 VARCHAR(45), PRIMARY KEY (COL1)) """ 
cursor.execute(sql)

 
#insert to table
cursor.execute("""INSERT INTO try VALUES (%s,%s)""",("opa","myghost"))
db.commit()   
db.rollback()
#show table
cursor.execute("""SELECT * FROM try""")

print cursor.fetchall()
db.close()

    
#####################    #Server Connection to MySQL:
  #  conn =MySQLdb.connect(host= "localhost",
   #                   user="root",
    #                  passwd="newpassword",
     #                 db="new_schema")

    #x=conn.cursor()

    #x.execute("SELECT *  FROM game")


    #row = x.fetchall()


    print "Connected to the Database"

##################    #Server Waiting for any Clients:  
while True:
        (clientSocket, address) = serversocket.accept()
        print 'New connection from ', address
        ct = Client(clientSocket)
        ct.start()



        
__all__ = ['allClients','Client']


python spaces error
===

I'm just fed up from python codes and spaces can any one help me in this code spaces!!

    enter code here

import sys
from threading import Thread
import socket
import MySQLdb

allClients=[]

class Client(Thread):
    
    def __init__(self,clientSocket):
                Thread.__init__(self)
                self.sockfd = clientSocket #socket client
                self.name = ""
                self.nickName = ""

    def newClientConnect(self):
         
      allClients.append(self.sockfd)
while True:  
#while True:
      try:
             rm= self.sockfd.recv(2048)
             print rm
             
             def run(self):
                self.newClientConnect()
                while True:
                        buff = self.sockfd.recv(2048)
                        if buff.strip() == 'quit':
                             self.sockfd.close()
                            break # Exit when break
                            else:
self.sendAll(buff)
                    
                    
if __name__ == "__main__": 

    #Server Connection to socket:
    IP = '10.0.2.2'
    PORT = 5807
    serversocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
    serversocket.setsockopt( socket.SOL_SOCKET, socket.SO_REUSEADDR, 1 )
    print ("Server Started")
    try:
        serversocket.bind(('',54638))
    except ValueError,e:
        print e
    serversocket.listen(5)


    db= MySQLdb.connect(host= "localhost",
                  user="root",
                  passwd="newpassword",
                  db="new_schema")
#setup cursor
cursor = db.cursor()
#create anooog1 table
cursor.execute("DROP TABLE IF EXISTS try")
#sql = """CREATE TABLE game (COL1 INT, COL2 INT, PRIMARY KEY (COL1))"""
sql="""CREATE TABLE try (COL1 VARCHAR(45), COL2 VARCHAR(45), PRIMARY KEY (COL1)) """ 
cursor.execute(sql)

 
#insert to table
cursor.execute("""INSERT INTO try VALUES (%s,%s)""",("opa","myghost"))
db.commit()   
db.rollback()
#show table
cursor.execute("""SELECT * FROM try""")

print cursor.fetchall()
db.close()

    
#####################    #Server Connection to MySQL:
  #  conn =MySQLdb.connect(host= "localhost",
   #                   user="root",
    #                  passwd="newpassword",
     #                 db="new_schema")

    #x=conn.cursor()

    #x.execute("SELECT *  FROM game")


    #row = x.fetchall()


    print "Connected to the Database"

##################    #Server Waiting for any Clients:  
while True:
        (clientSocket, address) = serversocket.accept()
        print 'New connection from ', address
        ct = Client(clientSocket)
        ct.start()



        
__all__ = ['allClients','Client']

