summaryrefslogtreecommitdiff
path: root/example.py
diff options
context:
space:
mode:
authorGustavo Niemeyer <gustavo@niemeyer.net>2011-03-24 14:16:39 -0300
committerGustavo Niemeyer <gustavo@niemeyer.net>2011-03-24 14:16:39 -0300
commitac37a80ce677025e03951091284feab1eadc0404 (patch)
tree0d9d2c886439affe076804fcbefc20fd98bc56ea /example.py
parent30af0028a6633dc415a6c41bf2f2a67bda9bb68a (diff)
downloaddateutil-ac37a80ce677025e03951091284feab1eadc0404.tar.gz
Applying Python 3 support patch by Brian Jones.
Diffstat (limited to 'example.py')
-rw-r--r--example.py14
1 files changed, 7 insertions, 7 deletions
diff --git a/example.py b/example.py
index f5a8e6f..ffa78e7 100644
--- a/example.py
+++ b/example.py
@@ -3,13 +3,13 @@ from dateutil.easter import *
from dateutil.rrule import *
from dateutil.parser import *
from datetime import *
-import commands
+import subprocess
import os
-now = parse(commands.getoutput("date"))
+now = parse(subprocess.getoutput("date"))
today = now.date()
-year = rrule(YEARLY,bymonth=8,bymonthday=13,byweekday=FR)[0].year
+year = rrule(YEARLY, bymonth=8, bymonthday=13, byweekday=FR)[0].year
rdelta = relativedelta(easter(year), today)
-print "Today is:", today
-print "Year with next Aug 13th on a Friday is:", year
-print "How far is the Easter of that year:", rdelta
-print "And the Easter of that year is:", today+rdelta
+print("Today is:", today)
+print("Year with next Aug 13th on a Friday is:", year)
+print("How far is the Easter of that year:", rdelta)
+print("And the Easter of that year is:", today+rdelta)