Spaces:
Runtime error
Runtime error
castorfou
commited on
Commit
•
48284e5
1
Parent(s):
c5ef53e
2022-10-07_13:45
Browse files
app.py
CHANGED
@@ -14,20 +14,18 @@ from rbc import add_classements
|
|
14 |
def analyse_fichier(file):
|
15 |
fichier = file[0]
|
16 |
fichier_save = Path(fichier.name).stem
|
17 |
-
print(fichier_save)
|
18 |
|
19 |
df_adherents = pd.read_excel(fichier)
|
20 |
df_classements = add_classements(df_adherents)
|
21 |
|
22 |
with tempfile.NamedTemporaryFile(prefix=fichier_save+'_', suffix=".xlsx", delete=False) as temp:
|
23 |
-
print(temp.name)
|
24 |
df_classements.to_excel(temp.name)
|
25 |
return temp.name
|
26 |
|
27 |
-
with gr.Blocks() as
|
28 |
file = gr.File(label="Adhérents", file_count=1)
|
29 |
greet_btn = gr.Button("Ajoute Classements")
|
30 |
outputs = gr.File(label="Adhérents avec classement", file_count=1, visible=True)
|
31 |
greet_btn.click(fn=analyse_fichier, inputs=file, outputs=outputs)
|
32 |
|
33 |
-
|
|
|
14 |
def analyse_fichier(file):
|
15 |
fichier = file[0]
|
16 |
fichier_save = Path(fichier.name).stem
|
|
|
17 |
|
18 |
df_adherents = pd.read_excel(fichier)
|
19 |
df_classements = add_classements(df_adherents)
|
20 |
|
21 |
with tempfile.NamedTemporaryFile(prefix=fichier_save+'_', suffix=".xlsx", delete=False) as temp:
|
|
|
22 |
df_classements.to_excel(temp.name)
|
23 |
return temp.name
|
24 |
|
25 |
+
with gr.Blocks() as classement_converter:
|
26 |
file = gr.File(label="Adhérents", file_count=1)
|
27 |
greet_btn = gr.Button("Ajoute Classements")
|
28 |
outputs = gr.File(label="Adhérents avec classement", file_count=1, visible=True)
|
29 |
greet_btn.click(fn=analyse_fichier, inputs=file, outputs=outputs)
|
30 |
|
31 |
+
classement_converter.launch()
|