lisab -h ja --abi võtmed ning mõne muu sõnaga saab elevandi väljavahetada mõne muu asja vastu
This commit is contained in:
parent
9b44d7c0dd
commit
fcc26ffe68
@ -1,20 +1,33 @@
|
|||||||
#!/usr/bin/env python3
|
#!/usr/bin/env python3
|
||||||
###########################################################################
|
########################################################################
|
||||||
# Kuule osta elevant ära #
|
# Kuule osta elevant ära #
|
||||||
# #
|
# #
|
||||||
# #
|
# #
|
||||||
#Author: Arti Zirk <arti.zirk@gmail.com #
|
#Author: Arti Zirk <arti.zirk@gmail.com> #
|
||||||
#License: Do What the Fuck You Want to Public License #
|
#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:
|
while True:
|
||||||
try:
|
try:
|
||||||
vastus = input("< ").lower()
|
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:
|
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()
|
exit()
|
||||||
except:
|
except:
|
||||||
print("Error, mingine kala ujus sisse")
|
print("Error, mingine kala ujus sisse")
|
Loading…
Reference in New Issue
Block a user