Created
December 4, 2016 10:54
-
-
Save mconcas/76d726379cb2ecc287e41de588deed40 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
import time, sys, signal, os | |
def signal_handler(signal, frame): | |
print("\nEh no, ora te li leggi tutti!\n") | |
# main-agioia | |
try: | |
sys.argv[1].lower() | |
except IndexError: | |
print "Uso:\n\t" + os.path.basename(__file__) + " *danilo*\n" | |
sys.exit(-1) | |
else: | |
if not "danilo" in sys.argv[1].lower(): | |
print "Uso:\n\t" + os.path.basename(__file__) + " *danilo*\n" | |
sys.exit(-1) | |
today_starts_at = 1480806000 # seconds | |
while time.time() > today_starts_at and time.time() < (today_starts_at + 86400): | |
print "\n Tanti auguri a te,\n Tanti auguri a te,\n Tanti auguri, %s!\n Tanti auguri a te!" % sys.argv[1].lower() | |
time.sleep(1) | |
signal.signal(signal.SIGINT, signal_handler) | |
print "Ora basta, la festa è finita, torna a lavorare!" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment