没有合适的资源?快使用搜索试试~ 我知道了~
首页python+mysql实现教务管理系统
本文实例为大家分享了python实现教务管理系统,供大家参考,具体内容如下 mysql+python构成教务管理系统,提供系统管理员,教职工,学生三级。有注册,添加,修改,发布信息等功能。 Login.py #-*- coding:utf-8 -*- #####系统登录 import os import MySQLdb import time class Login: def __init__(self,conn): self.account = '' self.password = '' self.level = 2 self.conn = conn def LoginSurf
资源详情
资源评论
资源推荐

python+mysql实现教务管理系统实现教务管理系统
本文实例为大家分享了python实现教务管理系统,供大家参考,具体内容如下
mysql+python构成教务管理系统,提供系统管理员,教职工,学生三级。有注册,添加,修改,发布信息等功能。
Login.py
#-*- coding:utf-8 -*-
#####系统登录
import os
import MySQLdb
import time
class Login:
def __init__(self,conn):
self.account = ''
self.password = ''
self.level = 2
self.conn = conn
def LoginSurface(self,info):
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.account,self.password,self.level]
def CheckAccount(self):
cur = self.conn.cursor()
sqlcmd = "select Account,Password,AccountLevel from LoginAccount where Account = '%s'" % self.account

















安全验证
文档复制为VIP权益,开通VIP直接复制

评论0