Skip to content

Commit b3c6ecf

Browse files
authored
Update App_Spec.py
1 parent c21c088 commit b3c6ecf

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

fun_SPEC_NEC/App_Spec.py

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import streamlit as st
1+
# import streamlit as st
22

33
# # --- Page Setup ---
44

@@ -25,29 +25,24 @@
2525
# pg.run()
2626

2727
import streamlit as st
28+
import runpy
2829

29-
# Define a simple navigation function
3030
def main():
3131
st.sidebar.title("Navigation")
32-
page = st.sidebar.radio("Go to", ["About Me", "Spec NEC"])
32+
app_mode = st.sidebar.radio("Go to", ["About Me", "Spec NEC"])
3333

34-
if page == "About Me":
34+
if app_mode == "About Me":
3535
about_me()
36-
elif page == "Spec NEC":
36+
elif app_mode == "Spec NEC":
3737
spec_nec()
3838

3939
def about_me():
40-
st.title("About Me")
41-
runpy('about_me.py')
40+
runpy.run_path('about_me.py')
4241

4342
def spec_nec():
44-
st.title("Spec NEC")
45-
runpy('SpecNec_executable_streamlit.py')
46-
47-
def runpy(filepath):
48-
with open(filepath) as file:
49-
exec(file.read(), globals())
43+
runpy.run_path('SpecNec_executable_streamlit.py')
5044

5145
if __name__ == "__main__":
5246
main()
5347

48+

0 commit comments

Comments
 (0)