Python Samples

Python Code Samples

Code written outside of classes.

HTML Scraper

A program that uses BeautifulSoup to parse a Web site.

HTML Scraper
                  
# A python program that scrapes data from a Web page
# and prints output to files.

from bs4 import BeautifulSoup
import requests
from docx import Document
from docx.shared import Pt
from docx.enum.dml import MSO_THEME_COLOR

# Set up HTML source and contents object
sourceURL = 'https://catherine.gurski.org/curriculum-vitae.html'
response = requests.get(sourceURL, timeout=5)
content = BeautifulSoup(response.content, "html.parser")

# Ignore the header and footer
content.header.decompose()
content.footer.decompose()

# Find contents by ID
workHistory = content.find("div", {"id":"workHistory"})
education = content.find("div", {"id": "education"})
memberships = content.find("div", {"id": "member"})
skills = content.find("div", {"class": "bg-light"})

# Find contents by tag
p = content.find_all('p')
li = content.find_all('li')
links = content.find_all('a')

# Print to txt file by ID
print("Work History", file=open("div_output.txt", "w", encoding="utf-8"))
print(workHistory, file=open("div_output.txt", "a", encoding="utf-8"))
print("\nEducation", file=open("div_output.txt", "a", encoding="utf-8"))
print(education, file=open("div_output.txt", "a", encoding="utf-8"))
print("\nSkills", file=open("div_output.txt", "a", encoding="utf-8"))
print(skills, file=open("div_output.txt", "a", encoding="utf-8"))
print("\nMemberships", file=open("div_output.txt", "a", encoding="utf-8"))
print(memberships, file=open("div_output.txt", "a", encoding="utf-8"))

# Print to text file by HTML Tag
with open('tag_output.txt', 'w', encoding="utf-8") as f:
	f.write('Paragraph Text\n')
	for para in p:
		f.write(para.text + "\n")
	f.write('\nList Items\n')
	for item in li:
		f.write(item.text + "\n")
	f.write('\nLinks\n')
	for link in links:
		f.write(link.get('href') + "\n")

# Create a Word document
document = Document()

style = document.styles['Normal']
font = style.font
font.name = 'Calibri'

heading1_style = document.styles['Heading 1']
heading1_font = heading1_style.font
heading1_font.size = Pt(18)
heading1_font.name = 'Calibri'
heading1_font.color.theme_color = MSO_THEME_COLOR.ACCENT_1
heading1_font.bold = False

heading2_style = document.styles['Heading 2']
heading2_font = heading2_style.font
heading2_font.size = Pt(16)
heading2_font.name = 'Calibri'
heading2_font.color.theme_color = MSO_THEME_COLOR.ACCENT_1
heading2_font.bold = False

header = document.sections[0].header
header.add_paragraph('Cathy Gurski\nPython-Docx Example')

document.add_heading('Cathy Gurski Curriculum Vitae')

document.add_heading(skills.find('h2'), level=2)

for li in skills.find_all('li'):
	document.add_paragraph(li.text, style='List Bullet')

document.add_heading(workHistory.find('h2'), level=2)

for p in workHistory.find_all('p'):
	document.add_paragraph(p.text)

document.add_heading(education.find('h2'), level=2)

for p in education.find_all('p'):
	document.add_paragraph(p.text)

document.add_heading(memberships.find('h2'), level=2)

for p in memberships.find_all('p'):
	document.add_paragraph(p.text)

document.save('python-docx.docx')               
                  
                

Right-click and select "Save link as..." to download the files needed to run this program:

Sample Output:



ICT 4370: Python Programming

Code written during pursuit of my Masters.

Week 1: Stock Earnings Summary

A program that gets user input and performs calculations.

Stock Earnings Summary
                      
# A python program that asks for user input regarding 
# their stock purchases then calculates earnings or loss.

# Variable Declarations
name = input("What is your name? ")
stock_symbol = input("Which stock do you own? ")
shares = input("How many shares do you own? ")
shares = float(shares)
purchase_price = input("What was the purchase price? ")
purchase_price = float(purchase_price)
current_price = input("What is the current price? ")
current_price = float(current_price)

# Output Generation
print("Stock ownership for " + name.title()) # Print the name in title case
print("-------------------------------")
print(stock_symbol.upper() + ": " + str(shares)) # Print the stock symbol in upper case
print("Purchase Price: " + str(purchase_price))
print("Current Price per Share: " + str(current_price))
print("Earnings/Loss to-date: $" + str((current_price - purchase_price) * shares))
                      

                    

Right-click and select "Save link as..." to download the files needed to run this program:



Week 2: Stock Earnings Summary for Multiple Stocks

A program that reads data from Python collections (arrays), calculates earnings/losses, and creates a table.

Stock Earnings Summary, Multiple Stocks
                      
# A python program that calculates
# earnings and losses for stocks.

stock_symbols = ['GOOGL', 'MSFT', 'RDS-A', 'AIG', 'FB']
shares = [125, 85, 400, 235, 150]
purchase_price = [772.88, 56.60, 49.58, 54.21, 124.31]
current_value = [941.53, 73.04, 55.74, 65.27, 172.45]

print("Stock ownership for Bob Smith")
print("-------------------------------")
print("\nSTOCK\tSHARE#\tEARNINGS/LOSS") 
print("-----------------------------------")

for x in range(0, len(stock_symbols)): # Loop starting at first stock symbol until it runs out
	print (stock_symbols[x].ljust(5), "\t", shares[x], "\t", "$", # Output stock info with formatting and rounding
	round((purchase_price[x] - current_value[x]) * shares[x],2))
                      
                    

Right-click and select "Save link as..." to download the files needed to run this program:



Week 3: Stock Earnings Summary for Multiple Stocks using Dictionaries

A program that reads data from Python dictionaries, calculates earnings/losses, and creates a table.

Stock Earnings Summary, Multiple Stocks from dictionaries
                        
# A python program that calculates
# earnings and losses for stocks, using dictionaries.

# Dictionary for an investor information. Since  we may need to add more investors who will share the same 
#static attributes a dictionary seems appropriate.

investors = {
	'Bob Smith': {
# Stock information. Since investors may have different stocks, number of shares, different 
# purchase prices, and current value (depends on the stock and what day you check) a list 
# seems appropriate.
		'stock_symbols': ['GOOGL', 'MSFT', 'RDS-A', 'AIG', 'FB'],
		'shares': [125, 85, 400, 235, 150],
		'purchase_price': [772.88, 56.60, 49.58, 54.21, 124.31],
		'current_value': [941.53, 73.04, 55.74, 65.27, 172.45],
	},

	'Rachel Smith': {
		'stock_symbols': ['GOOGL', 'MSFT', 'RDS-A'],
		'shares': [125, 85, 400],
		'purchase_price': [772.88, 56.60, 49.58],
		'current_value': [941.53, 73.04, 55.74],
	}
}


# Loop through investor by name.
for investorname, stock_info in investors.items():
	print("\nStock ownership for " + investorname)
	print("----------------------------------------")
	print("\nSTOCK\tSHARE#\tEARNINGS/LOSS")
	print("------------------------------")

# Assign value to stock information from investor lists.
	stocks = stock_info['stock_symbols']
	stock_shares = stock_info['shares']
	stock_price = stock_info['purchase_price']
	stock_value = stock_info['current_value']

# Loop through investors to get stock information.
	for x in range(0, len(stocks)):
		print (stocks[x].ljust(5), "\t", stock_shares[x], "\t", "$", # Output stock info with formatting and rounding
		round((stock_price[x] - stock_value[x]) * stock_shares[x],2))
                  
                

Right-click and select "Save link as..." to download the files needed to run this program:



Week 4: Using datetime and Functions

A program that uses the datetime library and functions to calculate earnings and losses for stocks.

Stock Earnings Using Functions
                  
# A python program that uses functions to calculate
# earnings and losses for stocks.

import functions as gc

# Import datetime library

import datetime as dt

# Dictionary for investor information. Since we may need to add more investors who will share the same 
#static attributes a dictionary seems appropriate.

investors = {
	'Bob Smith': {
# Stock information. Since investors may have different stocks, number of shares, different 
# purchase prices, and current value (depends on the stock and what day you check) a list 
# seems appropriate.
		'stock_symbols': ['GOOGL', 'MSFT', 'RDS-A', 'AIG', 'FB','M', 'F', 'IBM'],
		'shares': [125, 85, 400, 235, 150, 425, 85, 80],
		'purchase_price': [772.88, 56.60, 49.58, 54.21, 124.31, 30.30, 12.58, 150.37],
		'current_value': [941.53, 73.04, 55.74, 65.27, 172.45, 23.98, 10.95, 145.30],
		'purchase_date':['2015-8-1', '2015-8-1', '2015-8-1', '2015-8-1', '2015-8-1', '2017-1-10', '2017-2-17', '2017-5-12'],
	},

	'Rachel Smith': {
		'stock_symbols': ['GOOGL', 'MSFT', 'RDS-A'],
		'shares': [125, 85, 400],
		'purchase_price': [772.88, 56.60, 49.58],
		'current_value': [941.53, 73.04, 55.74],
		'purchase_date':['2015-8-1', '2015-8-1', '2015-8-1'],
	}
}

# Loop through investor by name.
for investorname, stock_info in investors.items():
	print("\nStock ownership for " + investorname)
	print("----------------------------------------")
	print("\nSTOCK\tSHARE#\tEARNINGS/LOSS\tYEARLY EARNING/LOSS")
	print("----------------------------------------------------")

	# Assign value to stock information from investor lists.
	stocks = stock_info['stock_symbols']
	stock_shares = stock_info['shares']
	stock_price = stock_info['purchase_price']
	stock_value = stock_info['current_value']
	stock_purchase_date = stock_info['purchase_date']
	current_date = dt.date.today() # Get current date

	# Loop through investors to get stock information.
	for x in range(0, len(stocks)):
		print (stocks[x].ljust(5), "\t", stock_shares[x], "\t", "$", # Output stock info with formatting and rounding, using functions
			gc.calculate_earnings(stock_price[x], stock_value[x],stock_shares[x]), # Call calculate earnings function
			gc.calculate_yearly_earnings(stock_value[x], stock_price[x], current_date, stock_purchase_date[x]), "%") # Call calculate yearly earnings function
            

          

Right-click and select "Save link as..." to download the files needed to run this program:



Week 5: Stock Earnings Using Classes

A program that uses functions and classes to calculate earnings and losses for stocks.

Stock Earnings Using datetime, Functions, and Classes
            
# A python program that uses functions to calculate
# earnings and losses for stocks.

#import functions as gc

# Import datetime library
import datetime as dt

# Import investors class
from investors import *

# Import stocks and bonds classes

from stocks import *

# Dictionary for investor information. Since  we may need to add more investors who will share the same 
#static attributes a dictionary seems appropriate.
investor_list = {
	'Bob Smith': {
# Stock information. Since investors may have different stocks, number of shares, different 
# purchase prices, and current value (depends on the stock and what day you check) a list 
# seems appropriate.
		'stocks_owned': ['GOOGL', 'MSFT', 'RDS-A', 'AIG', 'FB','M', 'F', 'IBM'],
		'stock_quantity': [125, 85, 400, 235, 150, 425, 85, 80],
		'stock_purchase_price': [772.88, 56.60, 49.58, 54.21, 124.31, 30.30, 12.58, 150.37],
		'stock_current_value': [941.53, 73.04, 55.74, 65.27, 172.45, 23.98, 10.95, 145.30],
		'stock_purchase_date':['2015-8-1', '2015-8-1', '2015-8-1', '2015-8-1', '2015-8-1', '2017-1-10', '2017-2-17', '2017-5-12'],
		'bonds_owned': ['gt2:gov'],
		'bond_purchase_price':[100.02],
		'bond_current_value':[100.05],
		'bond_quantity':[200],
		'bond_coupon':[1.38],
		'bond_yield':[1.35],
		'bond_purchase_date':['2017-08-01'],
	},

	'Rachel Smith': {
		'stocks_owned': ['GOOGL', 'MSFT', 'RDS-A'],
		'stock_quantity': [125, 85, 400],
		'stock_purchase_price': [772.88, 56.60, 49.58],
		'stock_current_value': [941.53, 73.04, 55.74],
		'stock_purchase_date':['2015-8-1', '2015-8-1', '2015-8-1'],
		'bonds_owned': ['gt2:gov'],
		'bond_purchase_price':[100.02],
		'bond_current_value':[100.05],
		'bond_quantity':[200],
		'bond_coupon':[1.38],
		'bond_yield':[1.35],
		'bond_purchase_date':['2017-08-01'],
	}
}


#for investorname, stock_info in investor_list.items():
#	print("\nStock ownership for " + investorname)
#	print("----------------------------------------")
#	print("\nSTOCK\tSHARE#\tEARNINGS/LOSS\tYEARLY EARNING/LOSS")
#	print("----------------------------------------------------")

## Assign value to stock information from investor lists.
#stocks = stock_info['stocks_owned']
#stock_shares = stock_info['stock_quantity']
#stock_price = stock_info['stock_purchase_price']
#stock_value = stock_info['stock_current_value']
#stock_purchase_date = stock_info['stock_purchase_date']
#bonds = stock_info['bonds_owned']
#bond_shares = stock_info['bond_quantity']
#coupon = stock_info['bond_coupon']
#yield_bond = stock_info['bond_yield']



#for x in range(0, len(stocks)):
#		print (stocks[x].ljust(5), "\t", stock_shares[x], "\t", "$", # Output stock info with formatting and rounding, using functions
#			gc.calculate_earnings(stock_price[x], stock_value[x],stock_shares[x]), # Call calculate earnings function
#			gc.calculate_yearly_earnings(stock_value[x], stock_price[x], current_date, stock_purchase_date[x]), "%") # Call calculate yearly earnings function


investors = []
inv_id = 1

for investor_name, list_items in investor_list.items():
	stock_list = []
	bond_list = []

	for st in range(0,len(list_items['stocks_owned'])):
		stock_list.append(Stocks(st,list_items['stocks_owned'][st],list_items['stock_quantity'][st],list_items['stock_current_value'][st],list_items['stock_purchase_price'][st],list_items['stock_purchase_date'][st]))

	for bn in range(0, len(list_items['bonds_owned'])):
		bond_list.append(Bonds(bn,list_items['bonds_owned'][bn],list_items['bond_quantity'][bn],list_items['bond_current_value'][bn],list_items['bond_purchase_price'][bn],list_items['bond_purchase_date'][bn],list_items['bond_coupon'][bn],list_items['bond_yield'][bn]))

	investors.append(Investor(inv_id,investor_name,"address","phone",stock_list,bond_list))

	inv_id += 1


for investor in investors:
	print (investor.get_investor_info())
	print("\nStock Ownership")
	print("--------------------------------------------------------------------")
	print("STOCK\tSHARE#\tCURRENT PRICE\tEARNING/LOSS\tYEARLY EARNING/LOSS")
	for stock in investor.get_stocks():
		print(stock.get_stock_details())
	print("\nBond Ownership")
	print("-----------------------------------------------------------------------------------")
	print("BOND\tSHARE#\tCURRENT PRICE\tEARNING/LOSS\tYEARLY EARNING/LOSS\tCOUPON\tYIELD")
	for bond in investor.get_bonds():
		print (bond.get_bond_details())
	print("\n")
      

    

Right-click and select "Save link as..." to download the files needed to run program:



Week 6: Stocks/Bonds Report using External Files

A program that reads external CSV files to display a stocks/bonds report.

Stock/Bonds Report using External Files
      
# A python program that uses external files
# to display a stocks/bonds report

#import functions as gc
# Import datetime library
import datetime as dt

# Import investors class
from investors import *

# Import stocks and bonds classes

from stocks import *


filename = 'Lesson6_Data_Investors.csv'

try:
	with open(filename) as file_object:
		lines = file_object.readlines()

except FileNotFoundError:
	print(filename + " doesn't exist. Please check the filename and try again.")

else:
	for line in lines:
		l = line.rstrip().split(',')
		investors = Investor(l[0],l[1],l[2],l[3],[],[])

filename = 'Lesson6_Data_Stocks.csv'

try:
	with open(filename) as file_object:
		lines = file_object.readlines()

except FileNotFoundError:
	print(filename + " doesn't exist. Please check the filename and try again.")

else:
	id = 0
	for line in lines:
		l = line.rstrip().split(',')
		investors.add_stock(Stocks(id, l[1], l[2], l[3], l[4], l[5]))
	id += 1

filename = 'gurski_week6_output.txt'
with open(filename, 'w') as file_object:
	file_object.write(investors.get_investor_info() + '\n')
	file_object.write("\nStock Ownership")
	file_object.write("\n---------------------------------------------------------------------------------------\n")
	file_object.write("\nSTOCK\tSHARE#\tCURRENT PRICE\tEARNING/LOSS\tYEARLY EARNING/LOSS\n")

	for s in investors.get_stocks():
		file_object.write(s.get_stock_details())
#	print(investors.get_stock_info().get_stock_details())

filename = 'Lesson6_Data_Bonds.csv'

try:
	with open(filename) as file_object:
		lines = file_object.readlines()

except FileNotFoundError:
	print(filename + " doesn't exist. Please check the filename and try again.")

else:
	id = 0
	for line in lines:
		l = line.rstrip().split(',')
		investors.add_bond(Bonds(id, l[1], l[2], l[3], l[4], l[5], l[6], l[7]))
	id += 1

filename = 'gurski_week6_output.txt'
with open(filename, 'a') as file_object:
	file_object.write("\nBond Ownership")
	file_object.write("\n---------------------------------------------------------------------------------------\n")
	file_object.write("\nBOND\tSHARE#\tCURRENT PRICE\tEARNING/LOSS\tYEARLY EARNING/LOSS\tCOUPON\tYIELD\n")
	for s in investors.get_bonds():
		file_object.write(s.get_bond_details())
      

    

Right-click and select "Save link as..." to download the files needed to run this program:

Sample Output



Week 7: Stocks/Bonds Report using External Files and SQLite3

A program that uses external files and databases to display a stocks/bonds report.

Stock/Bonds Report using External Files and Databases
      
# A python program that uses external files
# to display a stocks/bonds report

#import functions as gc
# Import datetime library
import datetime as dt

import sqlite3 as sqlite3

# Import investors class
from investors import *

# Import stocks and bonds classes

from stocks import *

# Create data tables
def CreateTables(dbPath):
	sql_create_investors_table = """ CREATE TABLE IF NOT EXISTS investorTable (
	                                        investor_id integer PRIMARY KEY,
	                                        investor_name text NOT NULL,
	                                        investor_address text NOT NULL,
	                                        investor_phone_number text NOT NULL
	                                    ); """

	sql_create_stocks_table = """ CREATE TABLE IF NOT EXISTS stockTable (
	                                        investor_id integer NOT NULL,
	                                        symbol text NOT NULL,
	                                        purchase_price real NOT NULL,
	                                        current_price real NOT NULL,
	                                        quantity real NOT NULL,
	                                        purchase_date text NOT NULL,
	                                        current_date text NOT NULL
	                                    ); """

	sql_create_bonds_table = """ CREATE TABLE IF NOT EXISTS bondTable (
	                                        investor_id integer,
	                                        symbol text NOT NULL,
	                                        purchase_price real NOT NULL,
	                                        current_price real NOT NULL,
	                                        quantity real NOT NULL,
	                                        purchase_date text NOT NULL,
	                                        current_date text NOT NULL,
	                                        coupon real NOT NULL,
	                                        bond_yield real NOT NULL
	                                    ); """
	connection = sqlite3.connect(dbPath)
	cursor	=	connection.cursor()
	cursor.execute(sql_create_investors_table)
	cursor.execute(sql_create_stocks_table)
	cursor.execute(sql_create_bonds_table)
	connection.commit()	
	connection.close()

# Insert data into tables	
def WriteData(dbPath, investor):
	connection = sqlite3.connect(dbPath)
	cursor	=	connection.cursor()

	sql_insert_investor = "INSERT INTO investorTable VALUES (" + investor.investor_id + \
							", '" + investor.investor_name + "'" + \
							", '" + investor.investor_address + "'" + \
							", '" + investor.investor_phone_number + "'" + \
							")"

	print (sql_insert_investor)
	cursor.execute(sql_insert_investor)
	print ("Inserted: " + investor.investor_name)

	for stock in investor.get_stocks():
		sql_insert_stocks = "INSERT INTO stockTable VALUES (" + investor.investor_id + \
							", '" + stock.get_symbol() + "'" + \
							", " + str(stock.get_purchase_price()) + \
							", " + str(stock.get_current_price()) + \
							", " + str(stock.get_quantity()) + \
							", '" + stock.get_purchase_date() + "'" + \
							", '" + dt.date.strftime(stock.get_current_date(), "%m/%d/%Y") + "'" + \
							")"

		print (sql_insert_stocks)
		cursor.execute(sql_insert_stocks)

	for bond in investor.get_bonds():
		sql_insert_bonds = "INSERT INTO bondTable VALUES (" + investor.investor_id + \
							", '" + bond.get_symbol() + "'" + \
							", " + str(bond.get_purchase_price()) + \
							", " + str(bond.get_current_price()) + \
							", " + str(bond.get_quantity()) + \
							", '" + bond.get_purchase_date() + "'" + \
							", '" + dt.date.strftime(bond.get_current_date(), "%m/%d/%Y") + "'" + \
							", " + str(bond.get_coupon()) + \
							", " + str(bond.get_bond_yield()) + \
							")"

		print (sql_insert_bonds)
		cursor.execute(sql_insert_bonds)
	connection.commit()
	connection.close()

# Get data from files

filename = 'Lesson6_Data_Investors.csv'
dbPath = 'test.db'

try:
	with open(filename) as file_object:
		lines = file_object.readlines()

except FileNotFoundError:
	print(filename + " doesn't exist. Please check the filename and try again.")

else:
	for line in lines:
		l = line.rstrip().split(',')
		investors = Investor(l[0],l[1],l[2],l[3],[],[])

filename = 'Lesson6_Data_Stocks.csv'

try:
	with open(filename) as file_object:
		lines = file_object.readlines()

except FileNotFoundError:
	print(filename + " doesn't exist. Please check the filename and try again.")

else:
	id = 0
	for line in lines:
		l = line.rstrip().split(',')
		investors.add_stock(Stocks(id, l[1], l[2], l[3], l[4], l[5]))
	id += 1

filename = 'Lesson6_Data_Bonds.csv'

try:
	with open(filename) as file_object:
		lines = file_object.readlines()

except FileNotFoundError:
	print(filename + " doesn't exist. Please check the filename and try again.")

else:
	id = 0
	for line in lines:
		l = line.rstrip().split(',')
		investors.add_bond(Bonds(id, l[1], l[2], l[3], l[4], l[5], l[6], l[7]))
	id += 1

CreateTables(dbPath)

WriteData(dbPath, investors)
      

    

Right-click and select "Save link as..." to download the files needed to run this program:

Sample Output



Week 8: Stocks/Bonds Report using JSON data, matplotlib.pyplot, and pygal

A program that reads JSON data to save a stocks/bonds graph.

Stock/Bonds Graphs using JSON Data
      
# A python program that reads JSON data
# and creates Stock Data Graphs

import json

from datetime import datetime

import matplotlib.pyplot as plt

import pygal

filename = 'AllStocks.json'

# Get data from JSON Object and make lists.
with open(filename) as f:
	stock_data = json.load(f)

#print(stock_data)
names, dates, purchase_prices, highs, lows, current_prices, volumes = [],[],[],[],[],[],[]
stock_list = {}

for stock_dict in stock_data:
	stock_name = stock_dict['Symbol']
	stock_list[stock_name] = { 'stock_date': [], 'open_price': [], 'stock_high': [], 'stock_low': [], 'close_price': [], 'volume': []}


for stock_dict in stock_data:
	stock_name = stock_dict['Symbol']
	stock_list[stock_name]['stock_date'].append(datetime.strptime(stock_dict['Date'], "%d-%b-%y"))
	stock_list[stock_name]['open_price'].append(stock_dict['Open'])
	stock_list[stock_name]['stock_high'].append(stock_dict['High'])
	stock_list[stock_name]['stock_low'].append(stock_dict['Low'])
	stock_list[stock_name]['close_price'].append(stock_dict['Close'])
	stock_list[stock_name]['volume'].append(stock_dict['Volume'])


# Plot Data
fig = plt.figure(dpi=128, figsize=(10,6))

for stock in stock_list:
	#plt.plot (stock_list[stock]['stock_date'], stock_list[stock]['close_price'], c='purple')
	plt.plot (stock_list[stock]['stock_date'], stock_list[stock]['close_price'], label=stock)

# Format Plot
plt.title("Stock Portfolio")
plt.xlabel('Date', fontsize=16)
fig.autofmt_xdate()
plt.ylabel('Closing Price', fontsize=16)
plt.legend(loc='center right')
plt.tick_params(axis='both', which='major', labelsize=16)

plt.savefig('simplePlot.png')
      

    

Right-click and select "Save link as..." to download the files needed to run this program:

Sample Output: