alston_exp.py 419 B

123456789101112131415161718
  1. import dataset
  2. from pymysql import*
  3. import xlwt
  4. import pandas.io.sql as sql
  5. # connect the mysql with the python
  6. con=connect(user="choozmo",password="pAssw0rd",host="db.ptt.cx",database="google_poi")
  7. # read the data
  8. #df=sql.read_sql('select * from shop_list2',con)
  9. df=sql.read_sql('select * from swire_store_list',con)
  10. # print the data
  11. print(df)
  12. # export the data into the excel sheet
  13. df.to_excel('storelist.xlsx')