diff options
author | Samus_ <mail2samus@gmail.com> | 2010-03-21 09:11:07 (GMT) |
---|---|---|
committer | Samus_ <mail2samus@gmail.com> | 2010-03-21 09:11:07 (GMT) |
commit | b17ac6363b328fc56947e985493fcf32017d26ec (patch) | |
tree | 8e4cf8981d33f212c117018fb229e1368434e726 | |
parent | 06ef334c55d59a6cda05f1ebb525ff8b1a4fe9de (diff) |
enabling commandline argument for divisions
-rwxr-xr-x | fracciones.activity/gtkcake.py | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/fracciones.activity/gtkcake.py b/fracciones.activity/gtkcake.py index d4e874d..4f6328a 100755 --- a/fracciones.activity/gtkcake.py +++ b/fracciones.activity/gtkcake.py @@ -7,7 +7,7 @@ Tiene un borde de 30 pixeles. Pasado a coordenadas mundiales el radio es: (500-2*30)/(2*500) = 0.44 """ -import os +import os, sys import math import gtk import cairo @@ -141,7 +141,10 @@ class Cake(gtk.DrawingArea): if __name__ == "__main__": # Probamos el nuevo widget Cake window = gtk.Window() - cake = Cake(6) + try: + cake = Cake(int(sys.argv[1])) + except IndexError: + cake = Cake(6) window.add(cake) window.connect("destroy", gtk.main_quit) window.show_all() |