From fcc26ffe689070392c9edea81aad5bef43fa86a4 Mon Sep 17 00:00:00 2001 From: Arti Zirk Date: Fri, 24 Jan 2014 19:07:58 +0200 Subject: [PATCH] =?UTF-8?q?lisab=20-h=20ja=20--abi=20v=C3=B5tmed=20ning=20?= =?UTF-8?q?m=C3=B5ne=20muu=20=20s=C3=B5naga=20saab=20elevandi=20v=C3=A4lja?= =?UTF-8?q?vahetada=20m=C3=B5ne=20muu=20asja=20vastu?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py => elevant.py | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) rename main.py => elevant.py (53%) diff --git a/main.py b/elevant.py similarity index 53% rename from main.py rename to elevant.py index 5f20383..671e5c9 100755 --- a/main.py +++ b/elevant.py @@ -1,20 +1,33 @@ #!/usr/bin/env python3 -########################################################################### -# Kuule osta elevant ära # -# # -# # -#Author: Arti Zirk # +#License: Do What the Fuck You Want to Public License # +# # +######################################################################## -print("> Kuule osta elevant ära!") +import sys + +asi = " ".join(sys.argv[1:]) +if not asi.strip(): # argumente pole, kasuta vaikimisi asja + asi = "elevant" + + +abi="""Kuule osta elevant ära +Kasutus: main.py [asi | -h | --abi]""" +if asi in ("-h", "--abi",): + print(abi) + exit(0) + +print("> Kuule osta " + asi + " ära!") while True: try: vastus = input("< ").lower() - print("> Seda räägivad kõik, et " + vastus + " aga osta elevant ära!") + print("> Seda räägivad kõik, et " + vastus + " aga osta "+ asi +" ära!") except (EOFError, KeyboardInterrupt) as e: - print("\033[4D> Mis sul viga on, et elevanti ei taha ??") + print("\033[4D> Mis sul viga on, et " + asi + " ei taha ??") exit() except: print("Error, mingine kala ujus sisse")