Feeds:
Posts
Comments

Posts Tagged ‘bashrc’

Here is a python script to wish you Good Morning or Good Evening according to the time of the day.

#!/usr/bin/python
import time

current_hour = time.strptime(time.ctime(time.time())).tm_hour

if current_hour < 12 :
	print "Good Morning!"
elif current_hour == 12 :
	print "Good Noon!"
elif current_hour > 12 and current_hour < 18 :
	print "Good AfterNoon!"
elif current_hour >= 18 :
	print "Good Evening!"

Now if you want to display it when you open the console add the following line to your ~/.bashrc file.

python /path/to/the/script.py

Happy Hacking! 🙂

Read Full Post »

%d bloggers like this: