Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -151,10 +151,6 @@ def execute_cpp(code):
|
|
| 151 |
return f"C++ execution exception:\n{e}"
|
| 152 |
|
| 153 |
# UI setup
|
| 154 |
-
css = """
|
| 155 |
-
.python {background-color: #306998;}
|
| 156 |
-
.cpp {background-color: #050;}
|
| 157 |
-
"""
|
| 158 |
|
| 159 |
example_code = """
|
| 160 |
######-----------------------------------------------#######
|
|
@@ -181,11 +177,11 @@ print(f"Result: {result:.12f}")
|
|
| 181 |
print(f"Execution Time: {(end_time - start_time):.6f} seconds")
|
| 182 |
"""
|
| 183 |
|
| 184 |
-
with gr.Blocks(
|
| 185 |
gr.Markdown("## 🔁 Python to C++ Converter")
|
| 186 |
with gr.Row():
|
| 187 |
-
python = gr.
|
| 188 |
-
cpp = gr.
|
| 189 |
with gr.Row():
|
| 190 |
model = gr.Dropdown(["GPT", "Claude", "DeepSeek"], label="Select model", value="Claude")
|
| 191 |
with gr.Row():
|
|
|
|
| 151 |
return f"C++ execution exception:\n{e}"
|
| 152 |
|
| 153 |
# UI setup
|
|
|
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
example_code = """
|
| 156 |
######-----------------------------------------------#######
|
|
|
|
| 177 |
print(f"Execution Time: {(end_time - start_time):.6f} seconds")
|
| 178 |
"""
|
| 179 |
|
| 180 |
+
with gr.Blocks(title="Code Converter",theme=gr.themes.Soft()) as ui:
|
| 181 |
gr.Markdown("## 🔁 Python to C++ Converter")
|
| 182 |
with gr.Row():
|
| 183 |
+
python = gr.Code(label="Python code:",language='python', value=example_code, lines=12)
|
| 184 |
+
cpp = gr.Code(label="C++ code:",language='cpp', lines=12)
|
| 185 |
with gr.Row():
|
| 186 |
model = gr.Dropdown(["GPT", "Claude", "DeepSeek"], label="Select model", value="Claude")
|
| 187 |
with gr.Row():
|