forked from nishant-neo/webbrowser
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStart.py
More file actions
45 lines (41 loc) · 1.61 KB
/
Start.py
File metadata and controls
45 lines (41 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#-------------------------------------------------------------------------------
# Name: module1
# Purpose:
#
# Author: TRINITI
#
# Created: 17-08-2014
# Copyright: (c) TRINITI 2014
# Licence: <your licence>
#-------------------------------------------------------------------------------
webpage = """<html>
<h1>Level One Headings Use (H1) Tags</h1>
<p>Paragraphs use (P) tags. Unordered lists use (UL) tags.
<ul>
<li> List items use (LI) tags. </li>
<li> Text can be <b>bold (B) </b>, <i>italic (I)</i>, <small>small (SMALL)</small>, <big>big (BIG)</big>, or look like a <tt>typewriter (TT)</tt>.</li>
<li> There are also ordered list that use (OL) tags. Let's make one nested inside our current list item.
<ol><li> Text can also be <strong> strong (STRONG)</strong> or <em>emphasized (EM)</em>, which typically renders like bold and italics. </li>
<li> Webpages can have <a href = "target">hyperlinks (A HERF = "target") </a>.</li></ol>
<li> It is also possible to include images <img src = "cs262.png"></img> (IMG SRC = "cs262.png")</li>
</ul>
</p>
<p>We'll finish off with one last paragraph.</p>
</html>
"""
# Display the page!
import ply.lex as lex
import ply.yacc as yacc
import htmltokens
import htmlgrammar
import htmlinterp
import graphics as graphics
import jstokens
htmllexer = lex.lex(module=htmltokens)
htmlparser = yacc.yacc(module=htmlgrammar,tabmodule="parsetabhtml")
ast = htmlparser.parse(webpage,lexer=htmllexer)
jslexer = lex.lex(module=jstokens)
graphics.initialize() # Enables display of output.
htmlinterp.interpret(ast)
graphics.finalize() # Enables display of output.
x=input()