Last active
December 10, 2015 07:58
-
-
Save sleexyz/4404850 to your computer and use it in GitHub Desktop.
Calender script...
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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