Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -16,7 +16,7 @@ for lang, ext in zip(df["language"], df["extension"]):
|
|
16 |
|
17 |
def compute(lang):
|
18 |
|
19 |
-
report = f"## Summary:\n\n The `{lang}` language has {len(lang_to_ext[lang])} extensions: {', '.join(['`'+ext+'`' for ext in lang_to_ext[lang]])}.\n\n"
|
20 |
df_lang = df[df["language"]==lang]
|
21 |
|
22 |
for i, (ext, example) in enumerate(zip(df_lang["extension"], df_lang["content"])):
|
@@ -28,7 +28,7 @@ def compute(lang):
|
|
28 |
with gr.Blocks() as demo:
|
29 |
gr.Markdown(f"# Programming Languages for The Stack v2\n\nIn total there are **{len(langs)} languages** and **{len(exts)} extensions.**")
|
30 |
|
31 |
-
lang_select = gr.Dropdown(choices=langs)
|
32 |
md = gr.Markdown("")
|
33 |
|
34 |
lang_select.change(fn=compute, inputs=[lang_select], outputs=[md])
|
|
|
16 |
|
17 |
def compute(lang):
|
18 |
|
19 |
+
report = f"## Summary:\n\n The `{lang}` language has {len(lang_to_ext[lang])} extensions: {', '.join(sorted(['`'+ext+'`' for ext in lang_to_ext[lang]]))}.\n\n"
|
20 |
df_lang = df[df["language"]==lang]
|
21 |
|
22 |
for i, (ext, example) in enumerate(zip(df_lang["extension"], df_lang["content"])):
|
|
|
28 |
with gr.Blocks() as demo:
|
29 |
gr.Markdown(f"# Programming Languages for The Stack v2\n\nIn total there are **{len(langs)} languages** and **{len(exts)} extensions.**")
|
30 |
|
31 |
+
lang_select = gr.Dropdown(choices=langs, value="Python")
|
32 |
md = gr.Markdown("")
|
33 |
|
34 |
lang_select.change(fn=compute, inputs=[lang_select], outputs=[md])
|