tharun1507 commited on
Commit
00b3a06
·
verified ·
1 Parent(s): 97e27ef

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -5
app.py CHANGED
@@ -32,7 +32,6 @@ def explain_and_run_code(code_snippet):
32
 
33
  # Execute the code snippet and capture the output
34
  try:
35
- # Redirect print statements to a string
36
  import io
37
  import contextlib
38
 
@@ -45,14 +44,13 @@ def explain_and_run_code(code_snippet):
45
 
46
  return f"**Explanation:**\n{explanation}\n\n**Output:**\n{output}"
47
 
48
- # Create the Gradio Interface
49
  demo = gr.Interface(
50
  fn=explain_and_run_code,
51
  inputs=gr.Textbox(placeholder="Enter your code snippet here...", label="Code Snippet", lines=10),
52
  outputs=gr.Textbox(label="Explanation and Output", lines=15),
53
- title="""DECIPHER The Python Code Explainer
54
- Al Capstone Project
55
- (XII-C)""",
56
  theme="default"
57
  )
58
 
 
32
 
33
  # Execute the code snippet and capture the output
34
  try:
 
35
  import io
36
  import contextlib
37
 
 
44
 
45
  return f"**Explanation:**\n{explanation}\n\n**Output:**\n{output}"
46
 
47
+ # Create the Gradio Interface with centered title
48
  demo = gr.Interface(
49
  fn=explain_and_run_code,
50
  inputs=gr.Textbox(placeholder="Enter your code snippet here...", label="Code Snippet", lines=10),
51
  outputs=gr.Textbox(label="Explanation and Output", lines=15),
52
+ title="DECIPHER The Python Code Explainer\n\n Al Capstone Project\n (XII-C)",
53
+ description="This application explains Python code snippets and shows their output.",
 
54
  theme="default"
55
  )
56