<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 5.5.2654.45">
<TITLE>RE: Select one option from list</TITLE>
</HEAD>
<BODY>
<BR>

<P><FONT SIZE=2>#- Example: list = ['aaa', 'bbb', 'ccc']</FONT>
<BR><FONT SIZE=2>#- </FONT>
<BR><FONT SIZE=2>#- Script acts something like this:</FONT>
<BR><FONT SIZE=2>#- </FONT>
<BR><FONT SIZE=2>#- Select one option:</FONT>
<BR><FONT SIZE=2>#- [1] aaa</FONT>
<BR><FONT SIZE=2>#- [2] bbb</FONT>
<BR><FONT SIZE=2>#- [3] ccc</FONT>
<BR><FONT SIZE=2>#- Enter your selection:</FONT>
</P>

<P><FONT SIZE=2>Nop. But I implemented the same using dictionarys, it has the advantage that you can use anything as options:</FONT>
</P>

<P><FONT SIZE=2>options = {'1':'First', '2':'Second', 'Q':'Quit'}</FONT>
<BR><FONT SIZE=2>print 'Select one option'</FONT>
<BR><FONT SIZE=2>items = options.items()</FONT>
<BR><FONT SIZE=2>items.sort()</FONT>
<BR><FONT SIZE=2>for item in items:</FONT>
<BR>        <FONT SIZE=2>print '[%s] %s' % (item)</FONT>
<BR><FONT SIZE=2>chosen = ''</FONT>
<BR><FONT SIZE=2>while not options.has_key(chosen):</FONT>
<BR>        <FONT SIZE=2>chosen = raw_input('Enter your selection: ')</FONT>
<BR><FONT SIZE=2>print 'You choose: ', options[chosen]</FONT>
</P>

<P><FONT SIZE=2>Hope it helps.</FONT>
</P>

<P><FONT SIZE=2>.       Facundo</FONT>
</P>
<BR>
<BR>
<BR>
<BR>

<P><B><FONT SIZE=2>. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .</FONT></B></P>

<P><B><U><FONT SIZE=2>ADVERTENCIA </FONT></U> </B>
</P>

<P><B><FONT SIZE=2>La información contenida en este mensaje y cualquier archivo anexo al mismo, son para uso exclusivo del destinatario y pueden contener información confidencial o propietaria, cuya divulgación es sancionada por la ley. </FONT></B></P>

<P><B><FONT SIZE=2>Si Ud. No es uno de los destinatarios consignados o la persona responsable de hacer llegar este mensaje a los destinatarios consignados, no está autorizado a divulgar, copiar, distribuir o retener información (o parte de ella) contenida en este mensaje. Por favor notifíquenos respondiendo al remitente, borre el mensaje original y borre las copias (impresas o grabadas en cualquier medio magnético) que pueda haber realizado del mismo. </FONT></B></P>

<P><B><FONT SIZE=2>Todas las opiniones contenidas en este mail son propias del autor del mensaje y no necesariamente coinciden con las de Telefónica Comunicaciones Personales S.A. o alguna empresa asociada. </FONT></B></P>

<P><B><FONT SIZE=2>Los mensajes electrónicos pueden ser alterados, motivo por el cual Telefónica Comunicaciones Personales S.A. no aceptará ninguna obligación cualquiera sea el resultante de este mensaje. </FONT></B></P>

<P><B><FONT SIZE=2>Muchas Gracias.</FONT></B>
</P>

</BODY>
</HTML>