20 January 2022

If python is misbehaving on the server, do these three things at the command line.

echo "source /opt/rh/rh-python36/enable" >> .bashrc
source .bashrc
python

This generates linked JavaScript, CSS, an JS files.


#!/usr/bin/python
from sys import argv
root = argv[1]
outFile = open(root + ".html", "w")
outFile.write("<!doctype html>\n")
outFile.write("<!--Author: Morrison-->\n")
outFile.write("""
<html lang="en">
<head>
<title>%s</title>
<meta charset="utf-8"/>
<link rel="stylesheet" href="%s.css"/>
<script src="%s.js">
</script>
</head>
<body>
</body>
</html>""" %(root, root, root))
outFile.close()
outFile = open(root + ".css", "w")
outFile.write("""/*Author: Morrison*/
h1, h2, .display
{
    text-align:center;
}
canvas
{
    border:solid 1px black;
}
""")
outFile.close()
outFile = open(root + ".js", "w")
outFile.write("/*Author: Morrison*/\n")
outFile.close();

Here is table.css


table, th, td
{
    border: solid 1px black;
    border-collapse: collapse;
}
table
{
    margin-left:auto;
    margin-right:auto;
}
th, td
{
    padding:.5em;
}
th
{
    background-color:#001A57;
    color: white;
}

Yesterday's Problems Let's generate solutions.

Arrays

Nodes and Nodelists A node is an element on a web page. The function document.getElementById() returns a node. Nodes are als called HTMLElements.

Objects

Primitive vs. Object Let's generate solutions.

Classes