-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathutils.py
More file actions
103 lines (92 loc) · 3.92 KB
/
utils.py
File metadata and controls
103 lines (92 loc) · 3.92 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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
import inspect
import textwrap
import base64
import streamlit as st
def show_code(demo):
"""Showing the code of the demo."""
show_code = st.sidebar.checkbox("Show code", True)
if show_code:
# Showing the code of the demo.
sourcelines, _ = inspect.getsourcelines(demo)
st.code(textwrap.dedent("".join(sourcelines[1:])))
def show_text_color(texto,size=8,color='blue'):
st.markdown(r'''<font size='''+ str(size) + ''' color ='''+color+'''>'''+texto,unsafe_allow_html=True)
def show_image_local(ruta,size='60%'):
file_ = open(ruta, "rb")
contents = file_.read()
data_url = base64.b64encode(contents).decode("utf-8")
file_.close()
st.markdown(
f'<center> <img width={size} src="data:image/gif;base64,{data_url}" alt="cat gif"> </center>',
unsafe_allow_html=True,
)
def footer():
file_ = open("componentes/124534-tricube-spinner-1.gif", "rb")
contents = file_.read()
data_url = base64.b64encode(contents).decode("utf-8")
file_.close()
local_css("componentes/estilos.css")
file_ = open("componentes/logo_unam_oro.png", "rb")
contents = file_.read()
data_url2 = base64.b64encode(contents).decode("utf-8")
file_.close()
st.markdown(f"""<!DOCTYPE html>
<html lang="es">
<head>
<meta charset="UTF-8">
<title>Pie de pagina</title>
<meta name="viewport" >
<!--Iconos-->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
</head>
<body>
<!--::::Pie de Pagina::::::-->
<footer class="pie-pagina after main" tabindex="0">
<div class="grupo-1">
<div class="box">
<h4>Laboratorio de Inteligencia Artificial en Ciencias Exactas (LIACE),</h4>
<figure>
<a href="#">
<img src="data:image/gif;base64,{data_url}" alt="Logo de SLee Dw">
</a>
</figure>
</div>
<div class="box">
<h4>Instructores</h4>
<p2>Doctor José Guadalupe Pérez Ramírez </p>
<div class="red-social">
<a href="mailto:bokhimi@fisica.unam.mx?subject=Clases IA pagina" class="fa fa-envelope"></a>
<a href="https://www.youtube.com/channel/UC2U6mx7uYvCYU6F4tWUKJUQ/videos" class="fa fa-youtube"></a>
</div>
<p2>Karen Daniela Cruz Hernández </p>
<div class="red-social">
<a href="karen.daniela@ciencias.unam.mx" class="fa fa-envelope"></a>
</div>
<p2>Carlos Emilio Camacho Lorenzana </p>
<div class="red-social">
<a href="https://www.linkedin.com/in/carlos-emilio-camacho-lorenzana-618bb0128" class="fa fa-linkedin"></a>
<a href="https://github.com/LorenzanaGauge" class="fa fa-github"></a>
<a href="ccamacholorenzana@ciencias.unam.mx" class="fa fa-envelope"></a>
</div>
<p2>Abraham Galindo Ruiz </p>
<div class="red-social">
<a href="https://www.linkedin.com/in/abraham-galindo-ru%C3%ADz-08944a202/" class="fa fa-linkedin"></a>
<a href="https://github.com/Abrahamx9-R" class="fa fa-github"></a>
<a href="abraham_g_r@ciencias.unam.mx" class="fa fa-envelope"></a>
</div>
</div>
<div class="box">
<h4>Instituto de Física, UNAM </h4>
<figure>
<a href="#">
<img src="data:image/gif;base64,{data_url2}" alt="Logo de SLee Dw">
</a>
</figure>
</div>
</div>
</footer>
</body>
</html>""",unsafe_allow_html=True)
def local_css(file_name):
with open(file_name) as f:
st.markdown(f"<style>{f.read()}</style>",unsafe_allow_html=True)