From 8c00bbac16aa694cd07f34f1afe26079cef3fe4a Mon Sep 17 00:00:00 2001 From: zhaoqifa Date: Thu, 26 Nov 2015 13:23:38 +0800 Subject: [PATCH] write log to stdout --- python/hangover.py | 8 +------- python/smack_my_bitch_up.py | 8 +------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/python/hangover.py b/python/hangover.py index c9b63e1..1daab65 100755 --- a/python/hangover.py +++ b/python/hangover.py @@ -41,10 +41,4 @@ client.messages.create( body="Gonna work from home. " + random.choice(excuses) ) -try: - if not os.path.exists('logs'): - os.mkdir('logs') - with open('logs/file.txt', 'a') as lh: - lh.write("Message sent at " + strftime("%a, %d %b %Y %H:%M:%S") + "\n") -except Exception as e: - print e +print "Message sent at " + strftime("%a, %d %b %Y %H:%M:%S") diff --git a/python/smack_my_bitch_up.py b/python/smack_my_bitch_up.py index 32b209d..0884416 100755 --- a/python/smack_my_bitch_up.py +++ b/python/smack_my_bitch_up.py @@ -42,10 +42,4 @@ client.messages.create( body="Late at work. " + random.choice(reasons) ) -try: - if not os.path.exists('logs'): - os.mkdir('logs') - with open('logs/file.txt', 'a') as lh: - lh.write("Message sent at " + strftime("%a, %d %b %Y %H:%M:%S") + "\n") -except Exception as e: - print e +print "Message sent at " + strftime("%a, %d %b %Y %H:%M:%S")