sysHour = time.strftime("%H") #get the current military hour
if sys.platform == 'win32': #Time for cross-platform
userName = os.getenv('USERNAME') #windows
else:
userName = os.getenv('USER') #linux and others.
if sysHour >= 0 and sysHour < 12: #12am until 12pm
print "Good morning, " + userName + "."
elif sysHour >= 12 and sysHour < 18: #12pm to 6pm
print "Good afternoon, " + userName + "."
else:
print "Good evening, " + userName + "." #The hour is later then 6pm