Skip to content

Instantly share code, notes, and snippets.

@theharshbhatia
Created April 13, 2014 14:32
Show Gist options
  • Select an option

  • Save theharshbhatia/10586570 to your computer and use it in GitHub Desktop.

Select an option

Save theharshbhatia/10586570 to your computer and use it in GitHub Desktop.

Revisions

  1. theharshbhatia created this gist Apr 13, 2014.
    23 changes: 23 additions & 0 deletions Notifier.py
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,23 @@
    import os,datetime
    import os.path, time
    from os.path import join, getsize
    ct=datetime.datetime.now() #current time
    # folderpath="/Users/harshbhatia/Desktop/buyingiq/" #folderpath you want to check for modified files
    #pushd \\fileserver\Study Material ||all materials go to z drive atomatically
    folderpath="/Volumes/Study Material/Computer Science & IT/Even Sem 2014/"
    print "NOTLOG for Mac\n"
    print "Choose Your Directory"
    numofdays=int(raw_input("Please enter days of your absence(eg. 2 ): \n"))
    # numofdays=2 #num of days since users havent checked the folder
    print ct;
    for root, dirs, files in os.walk(folderpath):
    for name in files:
    tm= (os.path.getmtime(join(root,name)))
    tm1= (datetime.datetime.fromtimestamp(tm))
    tdelta= ct-tm1
    if int(tdelta.days)<=numofdays:
    print join(root,name)