Guest User

Untitled

a guest
Sep 4th, 2018
180
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.47 KB | None | 0 0
  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)
Add Comment
Please, Sign In to add comment