最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

python實(shí)現(xiàn)圖書(shū)借閱系統(tǒng)

 更新時(shí)間:2019年02月20日 11:33:04   作者:晚風(fēng)潤(rùn)的侯侯  
這篇文章主要為大家詳細(xì)介紹了python實(shí)現(xiàn)圖書(shū)借閱系統(tǒng),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下

本文實(shí)例為大家分享了python實(shí)現(xiàn)圖書(shū)借閱系統(tǒng)的具體代碼,供大家參考,具體內(nèi)容如下

部分代碼:

from flask import Flask,render_template
from flask import request
from DB import createdb
from flask import session

app = Flask(__name__)
app.config['SECRET_KEY'] = '123456'

# 首頁(yè)-->登錄頁(yè)面
@app.route('/')
def hello_world():
  return render_template('login.html')

# 注冊(cè)頁(yè)面
@app.route('/showregister')
def showregister():
  return render_template('register.html')

# 登錄頁(yè)面提交信息
@app.route('/login',methods=['GET','POST'])
def login():
  username = request.form.get('username')
  stuid = request.form.get('password') # 學(xué)號(hào)為密碼
  flag = createdb.selectStu(stuid,username)
  if flag:
    session['username'] = username
    session['stuid'] = stuid
    return render_template('index.html', stuid=stuid, username=username)
  else:
    return render_template('login.html')

# 注冊(cè)頁(yè)面提交信息
@app.route('/register',methods=['GET','POST'])
def register():
  username = request.form.get('username')
  stuid = request.form.get('password')# 學(xué)號(hào)為密碼
  return createdb.insert(stuid,username)

# 顯示書(shū)籍信息頁(yè)面
@app.route('/ShowBook')
def ShowBook():
  return createdb.queryAllBook()

# 顯示添加書(shū)籍頁(yè)面
@app.route('/AddBook')
def AddBook():
  return render_template('AddBook.html')

# 添加書(shū)籍信息
@app.route('/Add',methods=['GET','POST'])
def Add():
  bookName = request.form.get('bookname')
  bookAuthor = request.form.get('author')
  return createdb.addBook(bookName,bookAuthor)

# 顯示借閱書(shū)籍信息
@app.route('/BorrowBook')
def BorrowBook():
  return createdb.queryBorrowBook()

# 顯示借閱書(shū)籍信息
@app.route('/Borrow',methods=['GET','POSt'])
def Borrow():
  bookName = request.form.get('bookName')
  bookAuthor = request.form.get('bookAuthor')
  username = session.get('username')
  stuid = session.get('stuid')
  return createdb.Borrow(username,stuid,bookName,bookAuthor)

# 顯示借閱書(shū)籍信息
@app.route('/ReturnBook',methods=['GET','POST'])
def ReturnBook():
  bookName = request.form.get("bookName")
  return createdb.ReturnBook(bookName)

# 顯示借閱書(shū)籍信息
@app.route('/UserInfo')
def UserInfo():
  stuid = session.get('stuid')
  username = session.get('username')
  return render_template('userInfo.html',stuid = stuid,username = username)


if __name__ == '__main__':
  app.run(debug=True)

源碼下載:python實(shí)現(xiàn)圖書(shū)借閱系統(tǒng)

以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。

相關(guān)文章

  • python超簡(jiǎn)單解決約瑟夫環(huán)問(wèn)題

    python超簡(jiǎn)單解決約瑟夫環(huán)問(wèn)題

    這篇文章主要介紹了python超簡(jiǎn)單解決約瑟夫環(huán)問(wèn)題的方法,詳細(xì)描述的約瑟夫環(huán)問(wèn)題的描述與Python解決方法,需要的朋友可以參考下
    2015-05-05
  • python新手學(xué)習(xí)使用庫(kù)

    python新手學(xué)習(xí)使用庫(kù)

    在本篇文章里小編給大家整理的一篇關(guān)于python新手學(xué)習(xí)使用庫(kù)的相關(guān)方法和知識(shí)點(diǎn),需要的朋友們參考下。
    2020-06-06
  • python用reduce和map把字符串轉(zhuǎn)為數(shù)字的方法

    python用reduce和map把字符串轉(zhuǎn)為數(shù)字的方法

    最近在復(fù)習(xí)高階函數(shù)的時(shí)候,有一道題想了半天解不出來(lái)。于是上午搜索資料,看了下別人的解法,發(fā)現(xiàn)學(xué)習(xí)編程,思維真的很重要。下面這篇文章就來(lái)給大家介紹了python利用reduce和map把字符串轉(zhuǎn)為數(shù)字的思路及方法,有需要的朋友們可以參考借鑒,下面來(lái)一起看看吧。
    2016-12-12
  • 詳解如何列出已安裝的Python包

    詳解如何列出已安裝的Python包

    處理 Python 項(xiàng)目可能需要列出已安裝的 Python 包,以便管理依賴(lài)項(xiàng)、檢查更新或與其他人共享項(xiàng)目需求,在這篇文章中,我們將研究多種用于列出系統(tǒng)上安裝的 Python 包的技術(shù)
    2023-10-10
  • Python configparser模塊操作代碼實(shí)例

    Python configparser模塊操作代碼實(shí)例

    這篇文章主要介紹了Python configparser模塊操作代碼實(shí)例,文中通過(guò)示例代碼介紹的非常詳細(xì),對(duì)大家的學(xué)習(xí)或者工作具有一定的參考學(xué)習(xí)價(jià)值,需要的朋友可以參考下
    2020-06-06
  • Python開(kāi)發(fā)之迭代器&生成器的實(shí)戰(zhàn)案例分享

    Python開(kāi)發(fā)之迭代器&生成器的實(shí)戰(zhàn)案例分享

    在 Python 中,迭代器和生成器都是用來(lái)遍歷數(shù)據(jù)集合的工具,可以按需逐個(gè)生成或返回?cái)?shù)據(jù),從而避免一次性加載整個(gè)數(shù)據(jù)集合所帶來(lái)的性能問(wèn)題和內(nèi)存消耗問(wèn)題。本文主要和大家分享幾個(gè)貼近實(shí)際運(yùn)維開(kāi)發(fā)工作中的場(chǎng)景案例,希望對(duì)大家有所幫助
    2023-04-04
  • python實(shí)現(xiàn)滑雪游戲

    python實(shí)現(xiàn)滑雪游戲

    這篇文章主要為大家詳細(xì)介紹了python實(shí)現(xiàn)滑雪游戲,文中示例代碼介紹的非常詳細(xì),具有一定的參考價(jià)值,感興趣的小伙伴們可以參考一下
    2020-02-02
  • python中模塊的__all__屬性詳解

    python中模塊的__all__屬性詳解

    這篇文章主要介紹了python中模塊的__all__屬性詳解,具有一定參考價(jià)值,需要的朋友可以了解下。
    2017-10-10
  • 使用python+poco+夜神模擬器進(jìn)行自動(dòng)化測(cè)試實(shí)例

    使用python+poco+夜神模擬器進(jìn)行自動(dòng)化測(cè)試實(shí)例

    這篇文章主要介紹了使用python+poco+夜神模擬器進(jìn)行自動(dòng)化測(cè)試實(shí)例,具有很好的參考價(jià)值,希望對(duì)大家有所幫助。一起跟隨小編過(guò)來(lái)看看吧
    2020-04-04
  • python logging模塊的使用總結(jié)

    python logging模塊的使用總結(jié)

    這篇文章主要介紹了python logging模塊使用總結(jié)以上就是本文的全部?jī)?nèi)容,希望對(duì)大家的學(xué)習(xí)有所幫助,也希望大家多多支持腳本之家。,需要的朋友可以參考下
    2019-07-07

最新評(píng)論

沅江市| 柘荣县| 西安市| 宁南县| 同德县| 全南县| 白银市| 吉水县| 义马市| 平南县| 文昌市| 志丹县| 图木舒克市| 保亭| 沛县| 张家界市| 鄂尔多斯市| 措美县| 天柱县| 陇川县| 涟源市| 兴文县| 武城县| 保定市| 彰化市| 南郑县| 井研县| 岳池县| 朔州市| 五家渠市| 古浪县| 常宁市| 太康县| 玉环县| 澄江县| 宜丰县| 得荣县| 运城市| 夏邑县| 镇原县| 保亭|