2
0
mirror of https://github.com/narkoz/hacker-scripts synced 2025-08-28 21:27:54 +00:00

write log to stdout

This commit is contained in:
zhaoqifa 2015-11-26 13:23:38 +08:00
parent d4eccca9fb
commit 8c00bbac16
2 changed files with 2 additions and 14 deletions

View File

@ -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")

View File

@ -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")