Skip to content

Commit

Permalink
added and fixed web pages
Browse files Browse the repository at this point in the history
  • Loading branch information
Bruceli-iscool committed Jan 26, 2024
1 parent 829d36f commit f1f2ed3
Show file tree
Hide file tree
Showing 7 changed files with 45 additions and 6 deletions.
Binary file modified src/.VisualScript.py.swp
Binary file not shown.
Binary file modified src/.VisualScript.py.un~
Binary file not shown.
Binary file added src/.example.vs.un~
Binary file not shown.
8 changes: 4 additions & 4 deletions src/VisualScript.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import matplotlib.pyplot as plt
import sys
from statistics import *
fro flask import *
from flask import *
import webbrowser

tur = turtle
Expand Down Expand Up @@ -159,21 +159,21 @@ def returnMean(list):
sortedlist = sorted(list)
meannum = sum(sortedlist) / len(sortedlist)
return meannum
def webPage(title, header, content, contentt=None, contenttr=None, contentb=None, contenth=None, contentcb=None, cssfile=None, filename="index.html"):
def webPage(title=, header, content, contentt="", contenttr="", contentb="", contenth="", contentcb="", cssfile=None, filename="index.html"):
filenamecustom = filename
structure = f"""
<!DOCTOTYPE html>
<html>
<head>
<titiel>{title}</title>
<title>{title}</title>
<link rel="stylesheet" type="text/css" href="{cssfile}">
</head>
<body>
<h1>{header}</h1>
<p>{content}</p>
<p>{contentt}</p>
<p>{contenttr}</p>
<p>{contenttb}</p>
<p>{contentb}</p>
<p>{contenth}</p>
<p>{contentcb}</p>
</body>
Expand Down
35 changes: 33 additions & 2 deletions src/VisualScript.py~
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ import turtle
import matplotlib.pyplot as plt
import sys
from statistics import *
fro flask import *
from flask import *
import webbrowser

tur = turtle

Expand Down Expand Up @@ -158,7 +159,37 @@ def process_code(file):
sortedlist = sorted(list)
meannum = sum(sortedlist) / len(sortedlist)
return meannum
def
def webPage(title, header, content, contentt=None, contenttr=None, contentb=None, contenth=None, contentcb=None, cssfile=None, filename="index.html"):
filenamecustom = filename
structure = f"""
<!DOCTOTYPE html>
<html>
<head>
<titiel>{title}</title>
<link rel="stylesheet" type="text/css" href="{cssfile}">
</head>
<body>
<h1>{header}</h1>
<p>{content}</p>
<p>{contentt}</p>
<p>{contenttr}</p>
<p>{contentb}</p>
<p>{contenth}</p>
<p>{contentcb}</p>
</body>
</html>
"""

with open(filename, "w") as html:
html.write(structure)
webbrowser.open(filename)

def webPageStart(filename):
# opens html files only
webbrowser.open(filename)






Expand Down
2 changes: 2 additions & 0 deletions src/example.vs
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ x = returnMedian(list, "y")
log(x)
function print():
log("hello world")
content = "john"
webPage("steve", "tim", "timmy")
6 changes: 6 additions & 0 deletions src/example.vs~
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// this is a comment
list = [1, 2, 3, 4, 5, 6 , 7, 8, 9, 10, 10, 12, 11]
x = returnMedian(list, "y")
log(x)
function print():
log("hello world")

0 comments on commit f1f2ed3

Please sign in to comment.