diff options
author | Victor Cubas <vhcubas91@gmail.com> | 2013-01-18 19:34:05 (GMT) |
---|---|---|
committer | Victor Cubas <vhcubas91@gmail.com> | 2013-01-18 19:34:05 (GMT) |
commit | baeb3e223e4db00ad6e308ae1ea5a22458defeab (patch) | |
tree | 8f172d73a460ffc0371346f04113a88f13ddfa67 | |
parent | 49e6e56ffa5d613313fe2d1dc530d939be80cea7 (diff) |
Archivos del proyecto
-rw-r--r-- | config.ini | 11 | ||||
-rw-r--r-- | flaco.jpg | bin | 0 -> 46777 bytes | |||
-rw-r--r-- | gordo.jpg | bin | 0 -> 30329 bytes | |||
-rw-r--r-- | imagen.py | 45 | ||||
-rwxr-xr-x | programa.py | 21 | ||||
-rw-r--r-- | voice.py | 13 |
6 files changed, 90 insertions, 0 deletions
diff --git a/config.ini b/config.ini new file mode 100644 index 0000000..e8893c2 --- /dev/null +++ b/config.ini @@ -0,0 +1,11 @@ +[Pregunta1] = imagen1.jpg +Respuesta1 = 'gordo y flaco' + +[Pregunta2] = imagen1.jpg +Respuesta2 = 'alto y bajo' + +[Pregunta3] = imagen1.jpg +Respuesta3 = 'encima y debajo' + +[Pregunta4] = imagen1.jpg +Respuesta4 = 'oscuro y claro' diff --git a/flaco.jpg b/flaco.jpg Binary files differnew file mode 100644 index 0000000..a332772 --- /dev/null +++ b/flaco.jpg diff --git a/gordo.jpg b/gordo.jpg Binary files differnew file mode 100644 index 0000000..79d206c --- /dev/null +++ b/gordo.jpg diff --git a/imagen.py b/imagen.py new file mode 100644 index 0000000..d8c7020 --- /dev/null +++ b/imagen.py @@ -0,0 +1,45 @@ +#!/usr/bin/python +import gtk +import programa +import voice + +class MyApp(): + + def __init__(self): + window = gtk.Window() + vbox = gtk.VBox() + hbox = gtk.HBox() + imagen1 = gtk.Image() + imagen1.set_from_file('gordo.jpg') + imagen2 = gtk.Image() + imagen2.set_from_file('flaco.jpg') + + + + window.connect('destroy', self.destroy) + button1 = gtk.Button() + button1.set_label('Claro - Oscuro') + button2 = gtk.Button() + button2.set_label('Joven - Anciano') + button3 = gtk.Button() + button3.set_label('Gordo - Flaco') + + window.add(vbox) + window.set_title('Piensa y Escribe') + window.set_default_size(100,100) + window.set_position(gtk.WIN_POS_CENTER) + hbox.add(imagen1) + hbox.add(imagen2) + vbox.add(hbox) + vbox.add(button1) + vbox.add(button2) + vbox.add(button3) + #set_default_size + window.show_all() + + def destroy(self, window, data=None): + gtk.main_quit() + +if __name__ == "__main__": + my_app = MyApp() + gtk.main() diff --git a/programa.py b/programa.py new file mode 100755 index 0000000..0517626 --- /dev/null +++ b/programa.py @@ -0,0 +1,21 @@ +#!/usr/bin/python +import voice + +from ConfigParser import SafeConfigParser + + +def main(): + parser = SafeConfigParser() + parser.read('config.ini') + + print parser.get('Pregunta1', 'Respuesta1') + texto = parser.get('Pregunta1', 'Respuesta1') + voice.say(texto) + print parser.get('Pregunta2', 'Respuesta2') + texto = parser.get('Pregunta2', 'Respuesta2') + voice.say(texto) + +if __name__ == "__main__": + main() + + diff --git a/voice.py b/voice.py new file mode 100644 index 0000000..2d3432d --- /dev/null +++ b/voice.py @@ -0,0 +1,13 @@ +#!/usr/bin/python + +from subprocess import Popen + +def say(text): + Popen(['espeak', '-v', 'es', text]) + + +def main(): + say(a)#que es esto? + +if __name__ == "__main__": + main() |