Merge branch 'main' of https://github.com/666ghj/Weibo_PublicOpinion_AnalysisSystem
Showing
3 changed files
with
3 additions
and
3 deletions
| @@ -2,7 +2,7 @@ import os | @@ -2,7 +2,7 @@ import os | ||
| 2 | from sqlalchemy import create_engine | 2 | from sqlalchemy import create_engine |
| 3 | import pandas as pd | 3 | import pandas as pd |
| 4 | 4 | ||
| 5 | -engine = create_engine('mysql+pymysql://XiaoXueQi:XiaoXueQi@10.92.35.13/Weibo_PublicOpinion_AnalysisSystem?charset=utf8mb4') | 5 | +engine = create_engine('mysql+pymysql://XiaoXueQi:XiaoXueQi@47.92.235.6/Weibo_PublicOpinion_AnalysisSystem?charset=utf8mb4') |
| 6 | 6 | ||
| 7 | def save_to_sql(): | 7 | def save_to_sql(): |
| 8 | try: | 8 | try: |
| 1 | from pymysql import * | 1 | from pymysql import * |
| 2 | -conn = connect(host='10.92.35.13',port=3306,user='XiaoXueQi',password='XiaoXueQi',database='Weibo_PublicOpinion_AnalysisSystem') | 2 | +conn = connect(host='47.92.235.6',port=3306,user='XiaoXueQi',password='XiaoXueQi',database='Weibo_PublicOpinion_AnalysisSystem') |
| 3 | cursor = conn.cursor() | 3 | cursor = conn.cursor() |
| 4 | def query(sql,params,type="no_select"): | 4 | def query(sql,params,type="no_select"): |
| 5 | params = tuple(params) | 5 | params = tuple(params) |
| @@ -9,7 +9,7 @@ def stopWordList(): | @@ -9,7 +9,7 @@ def stopWordList(): | ||
| 9 | return [line.strip() for line in open('./model/stopWords.txt',encoding='utf8').readlines()] | 9 | return [line.strip() for line in open('./model/stopWords.txt',encoding='utf8').readlines()] |
| 10 | 10 | ||
| 11 | def get_img(field,tableName,targetImgSrc,resImgSrc): | 11 | def get_img(field,tableName,targetImgSrc,resImgSrc): |
| 12 | - con = connect(host='localhost',user='root',password='root',database='weiboarticles',port=3306,charset='utf8mb4') | 12 | + con = connect(host='47.92.235.6',user='XiaoXueQi',password='XiaoXueQi',database='Weibo_PublicOpinion_AnalysisSystem',port=3306,charset='utf8mb4') |
| 13 | cuser = con.cursor() | 13 | cuser = con.cursor() |
| 14 | sql = f'select {field} from {tableName}' | 14 | sql = f'select {field} from {tableName}' |
| 15 | cuser.execute(sql) | 15 | cuser.execute(sql) |
-
Please register or login to post a comment