forked from JMante1/jet-plugin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
retrieve_html.py
44 lines (34 loc) · 915 Bytes
/
retrieve_html.py
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
def retrieve_html(html_link):
"""
Open an html file and read in the html
Requirements
-------
None
Parameters
----------
html_link : string
the name of the html file to read in, e.g. f'{cwd}//bar_graph.html'
Returns
-------
read_html: string
the html read out of the file
Example
--------
import os
cwd = os.getcwd()
filename = os.path.join(cwd, 'bar_graph.html')
read_html = retrieve_html(filename)
Output:
<html>
<body>
<div>
<script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
</div>
</body>
</html>
"""
#open the htmllink file
fl = open(html_link, "r")
#read in the html
read_html = fl.read()
return (read_html)