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
# You have your csv data and it looks like so... It's in a file named "my_data.csv" and we want to import it into a table named "my_things". | |
"1", "Something", "0.50", "2013-05-05 10:00:00" | |
"2", "Another thing", "1.50", "2013-06-05 10:30:00" | |
# Now you want to import it, go to the command line and type: | |
$ PGPASSWORD=PWHERE psql -h HOSTHERE -U USERHERE DBNAMEHERE -c "\copy my_things FROM 'my_data.csv' WITH CSV;" | |
# Voila! It's impoted. Now if you want to wipe it out and import a fresh one, you would do this: |
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 tkinter import * | |
from tkinter import ttk | |
master = Tk() | |
master.geometry('750x350+200+200') | |
scale_1 = ttk.Scale(master, orient='horizontal', length=200, from_=10, to=30) | |
scale_1.pack(padx=10, pady=30, anchor='nw') | |
label_1 = ttk.Label(master, text='Hello World', background='orange', font=('Candara', 10, 'italic')) |
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 tkinter | |
from tkinter import ttk | |
import requests | |
class MoviesDB: | |
def __init__(self, master): | |
self.master = master | |
self.createWidgets() |
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
# code for the lesson "understanding query strings" | |
# section 2: lecture 9 | |
from flask import Flask, render_template, request | |
app = Flask(__name__) | |
@app.route('/index') | |
@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
# incremental source code for the lesson "numbers and floats" | |
# section 2: lecture 10 | |
from flask import Flask, render_template, request | |
app = Flask(__name__) | |
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
# incremental source code for the lesson "rendering html templates" | |
# section 2: lecture 11 | |
# TO USE THIS CODE, YOU NEED THE TEMPLATES FOLDER WITH THE HTML FILE. SEE THE OTHER LINK PROVIDED FOR THE HTML PAGE | |
from flask import Flask, render_template, request | |
app = Flask(__name__) |
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
# USE WITH THE PYTHON FILE PROVIDED | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Hello Home</title> | |
</head> | |
<body> |
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
# code for the lesson "jinja templating part 1" | |
# section 3: lecture 12 | |
# USE THIS CODE IN CONJUNCTION WITH THE HTML PROVIDED | |
from flask import Flask, render_template, request | |
app = Flask(__name__) | |
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
<!-- HTML CODE FOR JINJA2: PART 1 --> | |
<!-- USE WITH THE PYTHON FILE PROVIDED --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>Watchable</title> |
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
<!-- HTML FOR JINJA2 - PART 2 --> | |
<!-- USE WIHT THE PYTHON FILE PROVIDED --> | |
<!DOCTYPE html> | |
<html lang="en"> | |
<head> | |
<meta charset="UTF-8"> | |
<title>movie durations</title> | |
</head> |
OlderNewer