資源簡(jiǎn)介
9Tkinter.zip

代碼片段和文件信息
from?pymysql?import?*
def?connects():
????return?connect(“127.0.0.1“?“root“?‘root‘?‘cn‘)
class?Database:
????def?allUser(self):
????????conn?=connects()
????????cursor?=?conn.cursor()
????????cursor.execute(‘select?*?from?student‘)
????????data=cursor.fetchall()
????????conn.close()
????????return?data
????def?selAUser(selfsname):
????????????conn?=?connects()
????????????cursor?=?conn.cursor()
????????????sql=“select?*?from?student?where?stuID=%s“
????????????cursor.execute(sqlsname)
????????????data=cursor.fetchone()
????????????if?data?is?None:
????????????????data=““
????????????conn.close()
????????????return?data
????def?delUserByid(selfsid):
????????conn?=?connects()
????????cursor?=?conn.cursor()
????????sql=“delete?from?student?where?stuId=%s“
????????cursor.execute(sqlsid)
????????conn.commit()
????????conn.close()
????def?insUser(selfstudent):
????????conn?=?connects()
????????cursor?=?conn.cursor()
????????sql=“insert?into?student?values(null%s%s%s)“
????????cursor.execute(sql[student.stuNamestudent.stuSexstudent.stuAge])
????????conn.commit()
????????conn.close()
????def?updUser(selfstudent):
????????conn?=?connects()
????????cursor?=?conn.cursor()
????????sql=“update?student??set?stuName=%sstuSex=%sstuAge=%s?where?stuId=%s“
????????cursor.execute(sql?[student.stuName?student.stuSex?student.stuAgestudent.stuId])
????????conn.commit()
????????conn.close()
?屬性????????????大小?????日期????時(shí)間???名稱(chēng)
-----------?---------??----------?-----??----
?????文件????????1420??2018-10-24?22:51??9Tkinter\Connect.py
?????文件????????3759??2018-10-27?11:39??9Tkinter\Console.py
?????文件?????????910??2018-10-18?22:49??9Tkinter\Student.py
?????文件????????3740??2018-10-24?23:51??9Tkinter\System.py
評(píng)論
共有 條評(píng)論