daily pastebin goal
83%
SHARE
TWEET

Untitled

a guest Sep 4th, 2018 151 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. A_1.table
  2. A_2.table
  3. A_3.table
  4.    
  5. IP1, IP2, IP3.
  6.    
  7. username=x
  8. password=pw
  9. port=1234
  10.    
  11. def proc(db, hostname):
  12.     con = mysql.connector.connect(user=x, password=pw,
  13.                           host=hostname,
  14.                           database=db, port=1234)
  15.      db_cursor = con.cursor()
  16.      db_cursor.execute('SELECT * FROM table')
  17.      table_rows = db_cursor.fetchall()
  18.      df = pd.DataFrame(table_rows)
  19.      print(df.head(1))
  20. con.close()
  21.    
  22. a=map(proc, tablelist, hostlist)
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top