Python SQLite 教學

Author: Kelvin Huang

Python 與 SQLite 資料庫開發軟體,第一個範例是使用者登入的功能,

初次執行將會在同目錄建立 auth_demo.db ,提供建立資料表、註冊帳號、登入驗證 的功能

為了教學的說明,提供列出所有使用者的帳號與密碼,僅供示範,正式上線時應該移除

 

原始碼 [ https://www.cg.com.tw/Python-code/code-viewer.php?file=A-auth-sqlite3-v1.py ] 或 [ Share ]

執行

 

改為使用多個檔案。

此時如果沒有 dashboard.py 將會出現 can't open file ... No such file or directory 錯誤訊息!

撰寫 dashboard.py 提供登入之後的功能。

登入成功後,顯示功能頁。

 

 

Copyright © 2025 CG Digital Corp. All rights reserved.