Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
df5a879
Update GradeTracker.py
Benjamin-Reed Aug 19, 2025
e6e8952
update
Benjamin-Reed Aug 28, 2025
25fe2b2
Merge branch 'master' of https://github.com/Benjamin-Reed/pythonteach…
Benjamin-Reed Aug 28, 2025
c6556d4
Test
Benjamin-Reed Aug 28, 2025
d34a2bf
working on KSUscrape
Benjamin-Reed Aug 28, 2025
079a4b5
Changed code to output 1 csv page
Benjamin-Reed Aug 28, 2025
72f8352
Class work 8/28/25
Benjamin-Reed Aug 28, 2025
6746d6b
Completing P1M1 assignment
Benjamin-Reed Aug 29, 2025
ffbc81b
Practice code P1M1
Benjamin-Reed Aug 29, 2025
f31a019
Demo CalcGUI work
Benjamin-Reed Sep 15, 2025
802f861
Work on 1.3
Benjamin-Reed Sep 15, 2025
58d0fe4
update module 3.1
Benjamin-Reed Sep 16, 2025
2f94c9c
3.1 work
Benjamin-Reed Sep 19, 2025
61e2e3b
P1M3
Benjamin-Reed Sep 19, 2025
3239ff7
class work
Benjamin-Reed Sep 22, 2025
99278db
class work
Benjamin-Reed Sep 23, 2025
13302c9
P1M4
Benjamin-Reed Sep 24, 2025
9a13509
Module 5 Project
Benjamin-Reed Sep 25, 2025
0809366
P1M5
Benjamin-Reed Sep 25, 2025
a8e22e1
Work on P2M1
Benjamin-Reed Oct 6, 2025
443fdd6
P2M1 work
Benjamin-Reed Oct 7, 2025
6fba22c
P2M1 required code
Benjamin-Reed Oct 8, 2025
fd4e126
MySQL demo
Benjamin-Reed Oct 8, 2025
10154cc
P2M2 work
Benjamin-Reed Oct 14, 2025
7e00755
P2M2 required code
Benjamin-Reed Oct 15, 2025
dac03ff
M3 work
Benjamin-Reed Oct 20, 2025
e64571d
mod3 work
Benjamin-Reed Oct 22, 2025
b5bc323
m3 update
Benjamin-Reed Oct 23, 2025
863899f
P2M3 code
Benjamin-Reed Oct 23, 2025
39167e3
P2M4 work
Benjamin-Reed Oct 24, 2025
a7722db
P2M4 work
Benjamin-Reed Oct 27, 2025
2f2b55c
P2M5 Final code work
Benjamin-Reed Oct 27, 2025
48e8d37
Project work
Benjamin-Reed Oct 30, 2025
b9a9364
project work
Benjamin-Reed Oct 30, 2025
1a4818d
P2M5 work
Benjamin-Reed Nov 4, 2025
cd55617
Create SampleGradeTracker.py
Benjamin-Reed Nov 7, 2025
02d40c6
project work
Benjamin-Reed Nov 14, 2025
5937cf5
Merge branch 'master' of https://github.com/Benjamin-Reed/pythonteach…
Benjamin-Reed Nov 14, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file removed .DS_Store
Binary file not shown.
2 changes: 1 addition & 1 deletion 1 gradetracker/GradeTracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
import statistics as s

#add constants next
admins = {'Dominic':'Hacker','Faculty2':'ABC123','Faculty3':'123ABC'}
admins = {'Dominic':'Hacker','Faculty2':'ABC123','Faculty3':'123ABC','Benjamin':'Reed'}

# Like the admins above is a dictionary but of students.
# Dictionaries use curly brackets with colons to associate keys with values.
Expand Down
5 changes: 3 additions & 2 deletions 2 ksu scrape/ksu_scrape_new.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,11 @@ def scrape_ksu(ksu_url,page):
#using the lxml parser to process the web page text content
soup = BeautifulSoup(source, 'lxml')
#create a csv file in "w" write mode so we can add content to it.
ksu_news_csv = open("ksu_news_"+"{:%m_%d_%Y}".format(datetime.now())+"_p"+page+".csv","w")
ksu_news_csv = open("ksu_news_"+"{:%m_%d_%Y}".format(datetime.now())+"_all.csv", "a", newline="", encoding="utf-8")
csv_writer = csv.writer(ksu_news_csv)
#write the header row into our csv file
csv_writer.writerow(["Number","Title","URL","Date"])
if page == "1":
csv_writer.writerow(["Number","Title","URL","Date"])
#show the content of the website we retrieved so that we can find the unique tags around the content we want
#print(soup.prettify())

Expand Down
55 changes: 55 additions & 0 deletions 2 ksu scrape/ksu_scrape_one_csv.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
'''
To use this code, you will first need to install the three packages being imported below using pip or a manual install method.
This code was updated in August 2021 to use the new KSU news feed design.
'''
from bs4 import BeautifulSoup
import requests
import csv
from datetime import datetime

def scrape_ksu(ksu_url, page):
'''
This function is made for scraping the KSU news feed as of its redesign in August 2022.
Now returns rows instead of writing a CSV.
'''
# grab the basic content from a web page
source = requests.get(ksu_url + page).text
# using the lxml parser to process the web page text content
soup = BeautifulSoup(source, 'lxml')

# find posts
blog_list = soup.find('ul', class_='blog_listing')
blog_posts = blog_list.find_all('li')

rows = []
i = 1
for blog_post in blog_posts:
title = blog_post.h3.text

date = blog_post.p.text
date = date.strip().strip('"').strip()

URL = blog_post.find('a')['href']

rows.append([i, title, URL, date])
i += 1

return rows

# -------- main driver: scrape many pages, write one CSV --------
all_rows = []
base_url = 'https://www.kennesaw.edu/news/news-releases/index.php?&p='

# loop the pages you want (1..9); adjust range as needed
for i in range(1, 10):
page_rows = scrape_ksu(base_url, str(i))
all_rows.extend(page_rows)

# write everything once into one CSV
outfile = f"ksu_news_{datetime.now():%m_%d_%Y}_all.csv"
with open(outfile, "w", newline="", encoding="utf-8") as f:
writer = csv.writer(f)
writer.writerow(["Number", "Title", "URL", "Date"])
writer.writerows(all_rows)

print(f"Wrote {len(all_rows)} rows to {outfile}")
13 changes: 12 additions & 1 deletion 3 calcGUI/calcGUI.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from tkinter import *
from math import sqrt as sqr
from math import sin, cos, tan


class Calculator(Frame):
Expand Down Expand Up @@ -144,6 +145,16 @@ def create_widgets(self):
Creates the widgets to be used in the grid.
:return: None
"""

self.sin_bttn = Button(self, text="sin", width=20, height=3, bg="lightgrey", command=lambda: self.add_chr("sin"))
self.sin_bttn.grid(row=2, column=6, columnspan=1)

self.cos_bttn = Button(self, text="cos", width=20, height=3, bg="lightgrey", command=lambda: self.add_chr("cos"))
self.cos_bttn.grid(row=3, column=6, columnspan=1)

self.tan_bttn = Button(self, text="tan", width=20, height=3, bg="lightgrey", command=lambda: self.add_chr("tan"))
self.tan_bttn.grid(row=4, column=6, columnspan=1)

self.eq_bttn = Button(self, text="=", width=20, height=3, bg="lightgrey", command=lambda: self.calculate())
self.eq_bttn.grid(row=4, column=4, columnspan=2)

Expand Down Expand Up @@ -186,7 +197,7 @@ def create_widgets(self):
self.six_bttn = Button(self, text="6", width=9, height=3, command=lambda: self.add_chr(6))
self.six_bttn.grid(row=2, column=2)

self.one_bttn = Button(self, text="1", width=9, height=3, command=lambda: self.add_chr(1))
self.one_bttn = Button(self, text="Ben", width=9, height=3, command=lambda: self.add_chr("Reed"))
self.one_bttn.grid(row=3, column=0)

self.two_bttn = Button(self, text="2", width=9, height=3, command=lambda: self.add_chr(2))
Expand Down
Binary file removed 4 DB in Python/.DS_Store
Binary file not shown.
Binary file modified 4 DB in Python/SQLite Demo/myinventory.db
Binary file not shown.
Binary file removed 5 RaspberryPi button/.DS_Store
Binary file not shown.
Binary file removed 6 Web Page with Flask/.DS_Store
Binary file not shown.
4 changes: 4 additions & 0 deletions 6 Web Page with Flask/basic page/script1.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,9 @@ def home():
def about():
return render_template("about.html")

@app.route('/benjamin/')
def benjamin():
return render_template("benjamin.html")

if __name__=="__main__":
app.run(debug=True)
11 changes: 11 additions & 0 deletions 6 Web Page with Flask/basic page/templates/benjamin.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{% extends "layout.html" %}
{% block content %}
<div class="home">
<h1>Reed</h1>
<p>This is Benjamin's Flask Website Demo project website. {{myName}}</p>
<p><form action="{{ url_for('greet') }}" method='post'>
Please type your name: <input type='text' name='myName'><br>
<input type='submit' value='Submit'>
</form></p>
</div>
{% endblock %}
34 changes: 34 additions & 0 deletions Ben_Reed_script1.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
'''
This is a basic web page running with Flask.
'''

from flask import Flask, render_template, request
#This is the Flask object, we are creating an instance of the Flask class and storing it in the variable app
#__name__ is a special variable in Python that is the name of the module, which is this file's name without the .py extension
app=Flask(__name__)

#This is a decorator, it is a function that takes a function as a parameter!
#A decorator is a function that wraps another function
#This decorator is saying that when someone goes to the URL /greet, run the greet function
@app.route('/greet', methods=['POST'])
def greet():
inputName = request.form['myName']
ip = request.remote_addr
#write data to file or to DB
inputName = inputName.upper()+" hi! Visiting from " + str(ip)
return render_template("home.html",myName=inputName)

@app.route('/')
def home():
return render_template("home.html",myName="Type your name in the box and click submit!")

@app.route('/about/')
def about():
return render_template("about.html")

@app.route('/benjamin/')
def benjamin():
return render_template("benjamin.html")

if __name__=="__main__":
app.run(debug=True)
Loading