pip install web.py
pip install PyDBLite
python
import web
from pydblite import Base
python
db = Base('users.db')
db.create('users', 'name', 'email')
python
urls = (
'/users', 'Users'
)
class Users:
def GET(self):
try:
output = ""
for user in db.users:
output += f"Name: {user.name}, Email: {user.email}<br>"
return output
except Exception as e:
return f"An error occurred: {str(e)}"
python
app = web.application(urls, globals())
if __name__ == "__main__":
app.run()