DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Fourtwenty.py

06.23.2009
| 1843 views |
  • submit to reddit
        stupid simple python script for checking to see whether or not it's currently either 16:20 or 4:20 for whatever reason you'd ever want to do that

#!/usr/bin/env python

# stupid simple python script for checking to see 
# whether or not it's currently either 16:20 or 4:20 
# for whatever reason you'd ever want to do that

import sys, os
import time

dt = list(time.localtime())
hour = dt[3]
minute = dt[4]
if hour == 4 or 16 and minute == 20:
	print ""
	print "OHHHH YEAH SON LET'S SMOKE SOME SHIT"
else: 
	print ""
	print "NOT YET SON"
	print "the time is only",minute,"after",hour,"o'clock"