Skip to content

Instantly share code, notes, and snippets.

@sleexyz
Last active December 10, 2015 07:58
Show Gist options
  • Save sleexyz/4404850 to your computer and use it in GitHub Desktop.
Save sleexyz/4404850 to your computer and use it in GitHub Desktop.
Calender script...
#!/usr/bin/env python
#
# calen - a calender app
import os
import sys
from termcolor import colored
class entry:
def __init__(self, date, task):
self.date = date
self.task = task
def main(argv):
os.chdir(os.environ['HOME'])
f = open('cal')
for line in f.readlines()[:4]:
str = ""
#Print date
str = str + colored(line[:5], "yellow")
if(line[10] == ':'):
str = str + '\t' + line[15:].strip()
str = str + ' ' + colored(line[8:13],'green')
else:
str = str + '\t' + line[7:].strip()
print(str)
if __name__ == '__main__':
main(sys.argv[1:])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment