TypeError: tuple indices must be integers, not str
Résolu/Fermé
A voir également:
- Typeerror: tuple indices must be integers or slices, not str
- Tuple indices must be integers or slices, not str - Meilleures réponses
- Typeerror: list indices must be integers or slices, not tuple - Meilleures réponses
- The media could not be loaded either because the server or network failed traduction ✓ - Forum Mozilla Firefox
- List indices must be integers or slices not str ✓ - Forum Python
- I'm sorry to have to inform you that your message could not be delivered to one or more recipients. it's attached below. ✓ - Forum Mail
- % Ip addresses may not be configured on l2 links. - Forum CISCO
- No such file or directory ✓ - Forum Linux / Unix
1 réponse
NHenry
Messages postés
15113
Date d'inscription
vendredi 14 mars 2003
Statut
Modérateur
Dernière intervention
22 avril 2024
331
11 mai 2019 à 20:43
11 mai 2019 à 20:43
Comme l'indique l'erreur :
cur.fetchone()
retourne un tuple, pas un dictionnaire.
cur.fetchone()
retourne un tuple, pas un dictionnaire.
11 mai 2019 à 20:44
11 mai 2019 à 20:56
Il faudrait faire un print de data pour voir ce que cela contient.
Et avec ceci tu devrais pouvoir faire pareil en jouant sur les indices (0 à ....):
renvoit 'a'
11 mai 2019 à 22:53