Ver Mensaje Individual
  #5 (permalink)  
Antiguo 25/11/2013, 12:01
roberkas98
 
Fecha de Ingreso: noviembre-2013
Mensajes: 61
Antigüedad: 10 años, 5 meses
Puntos: 0
Respuesta: Repetir función-python

Cita:
Iniciado por razpeitia Ver Mensaje
Usa un while.

Código Python:
Ver original
  1. #!/usr/bin/env python
  2. # encoding: utf-8
  3. import os
  4. print "¿Que te apetece hacer?"
  5. print "1 = Jugar"
  6. print "2 = Internet"
  7. jugar = 1
  8. internet = 2
  9. todas = (1,2)#Están todas las funciones(jugar,internet...)
  10. continuar = True
  11. while continuar:
  12.     apetecible = int(raw_input ())#Hay que elegir entre las opciones
  13.     if apetecible in todas:
  14.         if apetecible == jugar:
  15.             os.system(r'"C:\Program Files (x86)\Skype\Phone\Skype.exe"')
  16.         elif apetecible == internet:
  17.             os.system(r'"C:\Program Files (x86)\Google\Chrome\Application\chrome.exe"')
  18.     else:
  19.         print "Elije una opcion de la lista"
  20.     continuar = ("s" == raw_input("Desea continuar? s/n").lower())
Muchas Gracias por ponerme otra forma!