-
Notifications
You must be signed in to change notification settings - Fork 20
/
test.py
40 lines (37 loc) · 1.16 KB
/
test.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
# import streamlit as st
#
# # Store the initial value of widgets in session state
# if "visibility" not in st.session_state:
# st.session_state.visibility = "visible"
# st.session_state.disabled = False
#
# col1, col2 = st.columns(2)
#
# with col1:
# st.checkbox("Disable selectbox widget", key="disabled")
# st.radio(
# "Set selectbox label visibility 👉",
# key="visibility",
# options=["visible", "hidden", "collapsed"],
# )
#
# with col2:
# option = st.selectbox(
# "How would you like to be contacted?",
# ("Email", "Home phone", "Mobile phone"),
# label_visibility=st.session_state.visibility,
# disabled=st.session_state.disabled,
# )
import subprocess
import sys
import pymysql
import pandas as pd
db = pymysql.connect(host='localhost', port=3306, user="root", password="root", database='differ')
cursor = db.cursor()
sql = "SELECT * FROM change_dto" # 替换为你的SQL语句
cursor.execute(sql)
results = cursor.fetchall()
cursor.close()
db.close()
dataframe = pd.DataFrame(results, columns=[i[0] for i in cursor.description]) # 根据你的列名进行修改
print(dataframe.head())