[Remind-Fans] Periodic Reminders Using Omits

@@ abouanass at gmail.com
Mon Mar 27 16:35:10 EST 2006


Hi

> ---------- start script -------------------
> #!/usr/bin/python
> #### edit the following to point to the datafile ####
> datafile = "schedule.data"
> #####################################################
>
> import datetime
> oneday = datetime.timedelta(days=1)
>
> # Get the data
> execfile(datafile)
>
> # Convert relevant dates to datetime objects
> startday = datetime.date(startdate[0],startdate[1],startdate[2])
> endday = datetime.date(enddate[0],enddate[1],enddate[2])
>
> skipdays = []
> for date in holidays:
> skipdays.append(datetime.date(date[0],date[1],date[2]))
>
> day = startday
> count = 0
> scheduledays = []
> while day <= endday:
> if day.weekday() < 5:
> try:
> skipdays.index(day)
> except:
> sequenceday = (count % 6) + 1
> count += 1
> scheduledays.append("REM %s MSG Day %d" % \
> (day.strftime('%a %d %b %Y'), sequenceday))
> day = day + oneday
>
> numdays = len(scheduledays)
> for i in range(numdays):
> # print "%s%%" % scheduledays[i]
> print "%s (%d/%d)%%" % (scheduledays[i],i+1,numdays)
> ---------- end script ---------------------

*********************************
Hmmm…

I have some errors:
RemScript: line 1: --------: command not found
/Users/aa/Library/Scripts/MISC/RemScript: line 4: datafile: command not found
import: Unable to open X server () [Invalid argument].
/Users/aa/Library/Scripts/MISC/RemScript: line 8: syntax error near
unexpected token `('
/Users/aa/Library/Scripts/MISC/RemScript: line 8: `oneday =
datetime.timedelta(days=1)'

Any idea?

Thanks
-------
 @@
-------



More information about the Remind-fans mailing list