-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
executable file
·24 lines (15 loc) · 757 Bytes
/
Copy pathmain.py
File metadata and controls
executable file
·24 lines (15 loc) · 757 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#! /usr/bin/env python
from http.server import ThreadingHTTPServer
from requestHandler import RequestHandler
# NOTE: if you get an SSL Certificate error on OSX (Macs) then you need to install
# the SSL certificates manually by calling the appropriate Python script. It is at
# /Applications/Python\ 3.12/Install\ Certificates.command
# NOTE: had to install Pillow image library using "pip install pillow"
# NOTE: had to install webscraper "pip install html-table-parser-python3"
def start_webserver():
"""Starts the webserver and then just waits forever"""
server = ThreadingHTTPServer(('', 8080), RequestHandler)
# Respond to requests until process is killed
server.serve_forever()
# Actually start the webserver
start_webserver()