Bonjour,
Je voudrais créer une Liste de listes, chacune de ces listes étant la liste des mots d'une ligne d'un document .txt.
Le problème c'est qu'au lieu de m'afficher les liste voulue il me marque "<built-in method split of str object at 0x02865C40>" pour chacune d'elle.
J'ai programmé ainsi :
Et il m'affiche :
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 import os l=[] o=open('andar.txt','r') for i in range(6) : a=o.readline() b=a.split l.append(b) for i in range(6) : print(l[i]) o.close
<built-in method split of str object at 0x02865AE0>
<built-in method split of str object at 0x0286FFA0>
<built-in method split of str object at 0x02865C40>
<built-in method split of str object at 0x0226BFA0>
<built-in method split of str object at 0x0286B120>
<built-in method split of str object at 0x0286B1C0>
Est-ce que quelqu'un sait d'ou cela peut venir ? Merci d'avance;
Partager