import dataset from pymysql import* import xlwt import pandas.io.sql as sql # connect the mysql with the python con=connect(user="choozmo",password="pAssw0rd",host="db.ptt.cx",database="google_poi") # read the data #df=sql.read_sql('select * from shop_list2',con) df=sql.read_sql('select * from swire_store_list',con) # print the data print(df) # export the data into the excel sheet df.to_excel('storelist.xlsx')