avr23-cds-translation2 / tabs /read_api_url.py
Demosthene-OR's picture
Update read_api_url.py
6b5bf84
import streamlit as st
import csv
@st.cache_data
def read_api_url():
api_url = []
# Ouvrir le fichier CSV en mode lecture
with open("api-url.txt", newline='') as fichier_csv:
lecteur_csv = csv.reader(fichier_csv)
# Lire toutes les lignes
ligne = next(lecteur_csv, None)
while ligne is not None:
api_url.append(ligne[0])
ligne = next(lecteur_csv, None)
return api_url