Ver Mensaje Individual
  #3 (permalink)  
Antiguo 24/11/2013, 17:44
Avatar de razpeitia
razpeitia
Moderador
 
Fecha de Ingreso: marzo-2005
Ubicación: Monterrey, México
Mensajes: 7.321
Antigüedad: 19 años, 1 mes
Puntos: 1360
Respuesta: Repetir función-python

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())