...
 
Commits (4)

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
;'''
c.execute(sql)
all_rows = c.fetchall()
print("Current TODOs: ")
for row in all_rows:
print(row)
#print (list_all())
\ No newline at end of file
name: SQLexercises
dependencies:
- python==3.7
- pip:
- django==2.2.1
\ No newline at end of file
import sqlite3
conn = sqlite3.connect('./TODOapp.sqlite')
c = conn.cursor()
def search():
user_search = str(input("type the item ID you want to look up"))
sql = f'''
SELECT
todo_id, content, created
FROM
app
WHERE
todo_id == "{user_search}"
'''
c.execute(sql)
row = c.fetchone()
print("The TODO you selected is:", row)
# This file must be used with "source bin/activate" *from bash*
# you cannot run it directly
deactivate () {
# reset old environment variables
if [ -n "${_OLD_VIRTUAL_PATH:-}" ] ; then
PATH="${_OLD_VIRTUAL_PATH:-}"
export PATH
unset _OLD_VIRTUAL_PATH
fi
if [ -n "${_OLD_VIRTUAL_PYTHONHOME:-}" ] ; then
PYTHONHOME="${_OLD_VIRTUAL_PYTHONHOME:-}"
export PYTHONHOME
unset _OLD_VIRTUAL_PYTHONHOME
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r
fi
if [ -n "${_OLD_VIRTUAL_PS1:-}" ] ; then
PS1="${_OLD_VIRTUAL_PS1:-}"
export PS1
unset _OLD_VIRTUAL_PS1
fi
unset VIRTUAL_ENV
if [ ! "$1" = "nondestructive" ] ; then
# Self destruct!
unset -f deactivate
fi
}
# unset irrelevant variables
deactivate nondestructive
VIRTUAL_ENV="/Users/raquel/PycharmProjects/week4day1/venv"
export VIRTUAL_ENV
_OLD_VIRTUAL_PATH="$PATH"
PATH="$VIRTUAL_ENV/bin:$PATH"
export PATH
# unset PYTHONHOME if set
# this will fail if PYTHONHOME is set to the empty string (which is bad anyway)
# could use `if (set -u; : $PYTHONHOME) ;` in bash
if [ -n "${PYTHONHOME:-}" ] ; then
_OLD_VIRTUAL_PYTHONHOME="${PYTHONHOME:-}"
unset PYTHONHOME
fi
if [ -z "${VIRTUAL_ENV_DISABLE_PROMPT:-}" ] ; then
_OLD_VIRTUAL_PS1="${PS1:-}"
if [ "x(venv) " != x ] ; then
PS1="(venv) ${PS1:-}"
else
if [ "`basename \"$VIRTUAL_ENV\"`" = "__" ] ; then
# special case for Aspen magic directories
# see http://www.zetadev.com/software/aspen/
PS1="[`basename \`dirname \"$VIRTUAL_ENV\"\``] $PS1"
else
PS1="(`basename \"$VIRTUAL_ENV\"`)$PS1"
fi
fi
export PS1
fi
# This should detect bash and zsh, which have a hash command that must
# be called to get it to forget past commands. Without forgetting
# past commands the $PATH changes we made may not be respected
if [ -n "${BASH:-}" -o -n "${ZSH_VERSION:-}" ] ; then
hash -r
fi
# This file must be used with "source bin/activate.csh" *from csh*.
# You cannot run it directly.
# Created by Davide Di Blasi <davidedb@gmail.com>.
# Ported to Python 3.3 venv by Andrew Svetlov <andrew.svetlov@gmail.com>
alias deactivate 'test $?_OLD_VIRTUAL_PATH != 0 && setenv PATH "$_OLD_VIRTUAL_PATH" && unset _OLD_VIRTUAL_PATH; rehash; test $?_OLD_VIRTUAL_PROMPT != 0 && set prompt="$_OLD_VIRTUAL_PROMPT" && unset _OLD_VIRTUAL_PROMPT; unsetenv VIRTUAL_ENV; test "\!:*" != "nondestructive" && unalias deactivate'
# Unset irrelevant variables.
deactivate nondestructive
setenv VIRTUAL_ENV "/Users/raquel/PycharmProjects/week4day1/venv"
set _OLD_VIRTUAL_PATH="$PATH"
setenv PATH "$VIRTUAL_ENV/bin:$PATH"
set _OLD_VIRTUAL_PROMPT="$prompt"
if (! "$?VIRTUAL_ENV_DISABLE_PROMPT") then
if ("venv" != "") then
set env_name = "venv"
else
if (`basename "VIRTUAL_ENV"` == "__") then
# special case for Aspen magic directories
# see http://www.zetadev.com/software/aspen/
set env_name = `basename \`dirname "$VIRTUAL_ENV"\``
else
set env_name = `basename "$VIRTUAL_ENV"`
endif
endif
set prompt = "[$env_name] $prompt"
unset env_name
endif
alias pydoc python -m pydoc
rehash
# This file must be used with ". bin/activate.fish" *from fish* (http://fishshell.org)
# you cannot run it directly
function deactivate -d "Exit virtualenv and return to normal shell environment"
# reset old environment variables
if test -n "$_OLD_VIRTUAL_PATH"
set -gx PATH $_OLD_VIRTUAL_PATH
set -e _OLD_VIRTUAL_PATH
end
if test -n "$_OLD_VIRTUAL_PYTHONHOME