#!/usr/bin/python
# -*- coding: utf-8 -*-

""" 
Adds a sequential number of users into a test database
with username: newusern and password newusern

Not for production usage
"""

import MySQLdb


hostname = # FILL IN 
username = # FILL IN 
password = # FILL IN 



# Simple routine to run a query on a database and print the results:
def doQuery( conn, n_users ) :
    cur = conn.cursor()

        try:
                for i in range(0,n_users):
                            cur.execute("""CREATE USER \'newuser%i\'@\'localhost\' IDENTIFIED BY \'password%i\'""" % (i,i) )
                                        cur.execute( """GRANT ALL PRIVILEGES ON * . * TO \'newuser%i\'@\'localhost\'""" % i )
                                                    cur.execute( """FLUSH PRIVILEGES""" )
                                                        except MySQLdb.Error, e:
                                                                try:
                                                                            print ("MySQL Error [%d]: %s" % (e.args[0], e.args[1]))
                                                                                    except IndexError:
                                                                                                print ("MySQL Error: %s" % str(e))


                                                                                                if __name__ == '__main__':
                                                                                                    print("Using mysql.connector…")
                                                                                                        myConnection = MySQLdb.connect( host=hostname, user=username, passwd=password, 20)
                                                                                                            doQuery( myConnection )
                                                                                                                myConnection.close()







@@ -384,20 +384,16 @@
 rsor()%0A%0A
-    
     try:
@@ -389,32 +389,24 @@
 )%0A%0A    try:%0A
-        
         for 
@@ -428,32 +428,16 @@
 users):%0A
-                
         
@@ -541,36 +541,8 @@
 ) )%0A
-                            
     
@@ -639,48 +639,8 @@
 i )%0A
-                                        
     
@@ -693,1204 +693,368 @@
     
-                                                    except MySQLdb.Error, e:%0A                                                                try:%0A                                                                            print (%22MySQL Error %5B%25d%5D: %25s%22 %25 (e.args%5B0%5D, e.args%5B1%5D))%0A                                                                                    except IndexError:%0A                                                                                                print (%22MySQL Error: %25s%22 %25 str(e))%0A%0A%0A                                                                                                if __name__ == '__main__':%0A                                                                                                    print(%22Using mysql.connector%E2%80%A6%22)%0A                                                                                                        myConnection = MySQLdb.connect( host=hostname, user=username, passwd=password, 20)%0A                                                                                                            doQuery( myConnection )%0A                                                                                                            
+except MySQLdb.Error, e:%0A        try:%0A            print (%22MySQL Error %5B%25d%5D: %25s%22 %25 (e.args%5B0%5D, e.args%5B1%5D))%0A        except IndexError:%0A            print (%22MySQL Error: %25s%22 %25 str(e))%0A%0A%0Aif __name__ == '__main__':%0A    print(%22Using mysql.connector%E2%80%A6%22)%0A    myConnection = MySQLdb.connect( host=hostname, user=username, passwd=password, 20)%0A    doQuery( myConnection )%0A
     
@@ -1075,13 +1075,12 @@
 lose()%0A%0A%0A%0A%0A%0A
-%0A

fix Python formatting