This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
draw the ball | |
""" | |
import pgzrun | |
WIDTH = 1000 | |
HEIGHT = 700 | |
COLOUR = (0, 0, 250) | |
ball = Actor("ball") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import pgzrun | |
HEIGHT = 800 | |
WIDTH = 1000 | |
BLACK = (0, 0, 0) | |
ship = Actor("playership") | |
ship.x = WIDTH // 2 | |
ship.bottom = HEIGHT |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import PySimpleGUI as sg | |
layout = [ | |
[sg.Text("Enter the URL: ", font=('Arial, 16')), | |
sg.Input("", font=('Arial, 16'), size=(40, 1), key='url'), | |
sg.Button('Get Data', font=('Arial, 16'), key='get', bind_return_key=True)], | |
[sg.Multiline('', font=('Arial', 16), size=(70,15), key='output', disabled=True)] | |
] | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sqlite3 | |
sql_query = """ CREATE TABLE IF NOT EXISTS tasks( | |
id INTEGER PRIMARY KEY, | |
taskname TEXT) """ | |
def execute_query(sql_query): | |
with sqlite3.connect('todolist') as db: | |
csr = db.cursor() | |
result = csr.execute(sql_query) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
app = Flask( | |
__name__, | |
template_folder = 'client/templates' | |
) | |
@app.route('/') | |
def index(): | |
return render_template('index.html') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template, request, redirect, url_for | |
from dbfunctions import add_new_task, get_complete_tasks, get_incomplete_tasks, mark_task_complete | |
app = Flask( | |
__name__, | |
template_folder = 'client/templates' | |
) | |
@app.route('/') | |
def index(): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template, request, redirect, url_for | |
from dbfunctions import add_new_task, get_complete_tasks, get_incomplete_tasks, mark_task_as_complete | |
app = Flask( | |
__name__, | |
template_folder = 'client/templates' | |
) | |
@app.route("/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template | |
app = Flask(__name__) | |
@app.route("/login") | |
def login(): | |
return render_template('login.html') | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template, redirect, url_for, request | |
app = Flask(__name__) | |
def verify_login(email, password): | |
stored_password = get_password(email) | |
if len(stored_passsword): | |
if password == stored_passsword: | |
return redirect("/") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from flask import Flask, render_template, redirect, url_for, request, session | |
from db_functions import get_password, insert_user | |
app = Flask(__name__) | |
app.secret_key = "123@abc" | |
def set_session(email): #{"logged_in": True, "email"='[email protected]'} | |
session["logged_in"] = True | |
session["email"] = email |