Commit e51d5693 authored by Raquel's avatar Raquel 💬

Merge branch 'week4day2' into 'master'

Week4day2

See merge request !7
parents 19d36ca8 a4941a38

Too many changes to show.

To preserve performance only 1000 of 1000+ files are displayed.

from flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Hello, World!'
"""
def greet(name):
return f'Hello' (name)
app.add.url etc
"""
\ No newline at end of file
name: week4day2
dependencies:
- python==3.7
- pip:
- django==2.2.1
- flask==1.0.3
- flask-sqlalchemy==2.4.0
- flask-migrate==2.5.2
.idea
.DS_Store
.sqlite3
from create_new_TODO import *
from delete_TODOS import *
from list_all_TODOS import *
from search_TODOS import *
def TODO_app():
print("Press \'h\' for help menu")
print("Press \'a\' to add a new TODO item to the list")
print("Press \'r\' to remove an item from the list")
print("Press \'l\' to look up an item on the list")
print("Press \'q\' to quit")
while True:
user_to_do = input("What do you want to do?")
if user_to_do == "a":
create_new_todo()
elif user_to_do == "r":
delete_TODO()
elif user_to_do == "s":
list_all()
elif user_to_do == "l":
search()
elif user_to_do == "h":
TODO_app()
elif user_to_do == "q":
break
print("goodbye")
print(TODO_app())
\ No newline at end of file
import sqlite3
conn = sqlite3.connect('./TODOapp.sqlite')
c = conn.cursor()
import datetime
def create_new_todo():
user_add = str(input("what do you want to add?"))
timestamp = datetime.datetime.now().strftime('%Y/%m/%d %H:%M:%S')
print(timestamp)
sql= f'''
INSERT INTO app
(content, created)
VALUES
("{user_add}", "{timestamp}");
'''
c.execute(sql)
conn.commit()
conn.close()
#print(create_new_todo())
import sqlite3
conn = sqlite3.connect('./TODOapp.sqlite')
c = conn.cursor()
def delete_TODO():
user_delete = str(input("type the item you want to delete"))
sql= f'''
DELETE FROM app
WHERE content == "{user_delete}"
'''
c.execute(sql)
conn.commit()
#print(delete_TODO())
\ No newline at end of file
import sqlite3
conn = sqlite3.connect('./TODOapp.sqlite')
c = conn.cursor()
def list_all():
sql = f'''
SELECT
*
FROM
app
ORDER BY
created ASC
;'''