91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 26KB
    文件類型: .zip
    金幣: 2
    下載: 1 次
    發布日期: 2021-09-02
  • 語言: Python
  • 標簽: Python??數據庫??

資源簡介

這是一個使用Python實現的基于dos下面向數據庫的教務管理系統,實現了管理員、教職工、學生三種不同身份的操作,可以實現的功能有:學生、教職工信息管理、不同權限的信息發布、管理各種信息等。代碼約1200行,對于python初學者應該能提供一些幫助

資源截圖

代碼片段和文件信息

#-*-?coding:utf-8?-*-
#####系統登錄

import?os
import?MySQLdb
import?time

class?Login:
def?__init__(selfconn):
self.account??=?‘‘
self.password?=?‘‘
self.level?=?2
self.conn?=?conn

def?LoginSurface(selfinfo):
os.system(‘cls‘)
width?=?50
title?=?‘LOGIN‘
body1?=?‘[A]Admin‘
body2?=?‘[T]Teacher‘
body3?=?‘[S]Student‘
body4?=?‘[Q]Quit‘
print?‘=‘?*?width
print?‘?‘?*?((width-len(title))/2)?title
print?‘?‘?*?((width-len(body1))/2)body1
print?‘?‘?*?((width-len(body1))/2)body2
print?‘?‘?*?((width-len(body1))/2)body3
print?‘?‘?*?((width-len(body1))/2)body4
print?‘?‘?*?((width-len(info))/2)?info
print?‘-‘?*?width

def?MainFunc(self):
err?=?‘‘
while?True:
self.LoginSurface(err)
level?=?raw_input(‘Access:‘)
level?=?level.upper()
if?level?==?‘A‘:self.level?=?0
elif?level?==?‘T‘:?self.level?=?1
elif?level?==?‘S‘:?self.level?=?2?
elif?level?==‘Q‘:?return?False
else?:?
err?=?‘Error?Action!‘
continue
self.account??=?raw_input(‘Account:‘)
self.password?=?raw_input(‘Password:‘)
if?self.CheckAccount():
err?=?‘Login?Success!‘
self.LoginSurface(err)
print?‘Please?wait...‘
time.sleep(3)
return?True;
else?:
err?=?‘Login?Failed!‘
def?GetLoginAccount(self):
return?[self.accountself.passwordself.level]

def?CheckAccount(self):
cur?=?self.conn.cursor()
sqlcmd?=?“select?AccountPasswordAccountLevel?from?LoginAccount?where?Account?=?‘%s‘“?%?self.account
if?cur.execute(sqlcmd)?==?0:?return?False
temp?=?cur.fetchone()
cur.close()
if?temp[1]?==?self.password?and?temp[2]?==?self.level:
return?True
else:?return?False

def?Quit(self):
pass

if?__name__?==?‘__main__‘:
conn?=?MySQLdb.connect(user=‘root‘passwd?=?‘‘db?=?‘DB_EducationalManagementSystem‘);
a?=?Login(conn)
a.MainFunc()
a.Quit()
conn.close()

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2016-10-17?19:31??教務管理系統\
?????文件????????1938??2016-10-17?19:31??教務管理系統\Login.py
?????文件????????2956??2016-10-17?19:31??教務管理系統\Login.pyc
?????文件????????6834??2016-10-17?16:00??教務管理系統\Student.py
?????文件????????7491??2016-10-17?16:21??教務管理系統\Student.pyc
?????文件???????19229??2016-10-17?19:12??教務管理系統\SystemManager.py
?????文件???????20612??2016-10-17?19:21??教務管理系統\SystemManager.pyc
?????文件????????9051??2016-10-17?16:05??教務管理系統\Teacher.py
?????文件????????9970??2016-10-17?16:21??教務管理系統\Teacher.pyc
?????文件?????????708??2016-10-17?16:20??教務管理系統\main.py
?????目錄???????????0??2016-10-17?19:32??教務管理系統\數據庫\
?????文件?????????153??2016-10-16?21:49??教務管理系統\數據庫\clear.sql
?????文件????????1597??2016-10-16?22:07??教務管理系統\數據庫\init.sql
?????文件????????6336??2016-10-17?19:28??教務管理系統\文檔.txt

評論

共有 條評論