Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- A_1.table
- A_2.table
- A_3.table
- IP1, IP2, IP3.
- username=x
- password=pw
- port=1234
- def proc(db, hostname):
- con = mysql.connector.connect(user=x, password=pw,
- host=hostname,
- database=db, port=1234)
- db_cursor = con.cursor()
- db_cursor.execute('SELECT * FROM table')
- table_rows = db_cursor.fetchall()
- df = pd.DataFrame(table_rows)
- print(df.head(1))
- con.close()
- a=map(proc, tablelist, hostlist)
Add Comment
Please, Sign In to add comment