# -- code python 5.18
import pyodbc
server = 'nomduserveur.database.windows.net'
database = 'Livres'
authentication = 'ActiveDirectoryInteractive'
ADusername ='nomutilisateur@nomdudomaine.com'
driver= '{ODBC Driver 17 for SQL Server}'
with pyodbc.connect('DRIVER= '+ driver +';SERVER=tcp:'+server+';PORT=1433;DATABASE='+database+';UID='+ADusername+';Authentication='+authentication) as conn:    
    with conn.cursor() as cursor:
        cursor.execute("SELECT auteur,titre FROM dbo.Livres")
        row = cursor.fetchall()
        for i in range(10):
            print(row[i])