HeavenWaters commited on
Commit
669fd47
·
verified ·
1 Parent(s): 07a2b88

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -11
app.py CHANGED
@@ -9,23 +9,20 @@ language = st.selectbox("Pick a Programming Language:",
9
  # Function to render markdown content with unsafe HTML based on the selected language
10
  def render_language_content(selected_language):
11
  if selected_language == "C":
12
- st.markdown("<h3 style='color:blue;'>You selected C.</h3><p>Add your custom HTML here.</p>",
13
- unsafe_allow_html=True)
14
  elif selected_language == "C++":
15
- st.markdown("<h3 style='color:green;'>You selected C++.</h3><p>Add your custom HTML here.</p>",
16
- unsafe_allow_html=True)
17
  elif selected_language == "C#":
18
- st.markdown("<h3 style='color:orange;'>You selected C#.</h3><p>Add your custom HTML here.</p>",
19
- unsafe_allow_html=True)
20
- elif selected_language == "JavaScript":
21
- st.markdown("<h3 style='color:red;'>You selected JavaScript.</h3><p>Add your custom HTML here.</p>",
22
- unsafe_allow_html=True)
23
  elif selected_language == "Python":
24
  website_url = "https://www.jdoodle.com/ia/1eQe"
25
  st.components.v1.html(f"""<iframe src="{website_url}" width="100%" height="700px" frameborder="0"></iframe>""",height=700,)
26
  elif selected_language == "HTML/CSS/JS":
27
- st.markdown("<h3 style='color:pink;'>You selected HTML/CSS/JS.</h3><p>Add your custom HTML here.</p>",
28
- unsafe_allow_html=True)
29
 
30
  # Call the function to render the selected content
31
  render_language_content(language)
 
9
  # Function to render markdown content with unsafe HTML based on the selected language
10
  def render_language_content(selected_language):
11
  if selected_language == "C":
12
+ website_url = "https://www.jdoodle.com/ia/1eQh"
13
+ st.components.v1.html(f"""<iframe src="{website_url}" width="100%" height="700px" frameborder="0"></iframe>""",height=700,)
14
  elif selected_language == "C++":
15
+ website_url = "https://www.jdoodle.com/ia/1eQj"
16
+ st.components.v1.html(f"""<iframe src="{website_url}" width="100%" height="700px" frameborder="0"></iframe>""",height=700,)
17
  elif selected_language == "C#":
18
+ website_url = "https://www.jdoodle.com/ia/1eQk"
19
+ st.components.v1.html(f"""<iframe src="{website_url}" width="100%" height="700px" frameborder="0"></iframe>""",height=700,)
 
 
 
20
  elif selected_language == "Python":
21
  website_url = "https://www.jdoodle.com/ia/1eQe"
22
  st.components.v1.html(f"""<iframe src="{website_url}" width="100%" height="700px" frameborder="0"></iframe>""",height=700,)
23
  elif selected_language == "HTML/CSS/JS":
24
+ website_url = "https://www.jdoodle.com/ih/1eQl"
25
+ st.components.v1.html(f"""<iframe src="{website_url}" width="100%" height="1000px" frameborder="0"></iframe>""",height=1000,)
26
 
27
  # Call the function to render the selected content
28
  render_language_content(language)