Help

hasna1980 Messages postés 14 Date d'inscription lundi 15 octobre 2007 Statut Membre Dernière intervention 6 mai 2008 - 10 avril 2008 à 16:45
beltegeuse Messages postés 44 Date d'inscription mardi 3 mai 2005 Statut Membre Dernière intervention 31 janvier 2009 - 16 avril 2008 à 21:06
j'ai un prbleme qd j'utilise unpack voici l erreur:







error: unpack requires a string argument of length 31





quelqu'un a une idée?

1 réponse

beltegeuse Messages postés 44 Date d'inscription mardi 3 mai 2005 Statut Membre Dernière intervention 31 janvier 2009 33
16 avril 2008 à 21:06
j'ai trouver ça sur internet :

<nobr><tt id= "l2h-445" xml="" class="function">unpack</tt>(</nobr>, <var>fmt, string</var>)

Unpack the string (presumably packed by
pack(<var>fmt</var>,
   ...)
) according to the given format. The result is a
tuple even if it contains exactly one item. The string must contain
exactly the amount of data required by the format
(
len(<var>string</var>)
must equal
calcsize(<var>fmt</var>)
).

si j'ai bien comprit à quoi ça sert tu as une différence alors que pour utiliser la fronction : len(string) ==
calcsize(<var>fmt</var>)


>> unpack(fmt,string)

Je t'invite à aller voir à cette adresse : http://docs.python.org/lib/module-struct.html#l2h-445
0
Rejoignez-nous