2
#pincal # pincal.py import os y = int(input("What year? (yyyy): ")) f = 2*(13) + (3*(13+1)//5) + (y-1) + ((y-1)//4) - ((y-1)//100) + ((y-1)//400) + 2 count = (f % 7) if((y%4 == 0 and y%100 != 0) or y%400 == 0): if count == 0: print('001'); os.startfile(r'C:\CalendarTemplates\001.pdf') elif count == 1: print('002'); os.startfile(r'C:\CalendarTemplates\002.pdf') elif count == 2: print('003'); os.startfile(r'C:\CalendarTemplates\003.pdf') elif count == 3: print('004'); os.startfile(r'C:\CalendarTemplates\004.pdf') elif count == 4: print('005'); os.startfile(r'C:\CalendarTemplates\005.pdf') elif count == 5: print('006'); os.startfile(r'C:\CalendarTemplates\006.pdf') elif count == 6: print('007'); os.startfile(r'C:\CalendarTemplates\007.pdf') else: if count == 0: print('008'); os.startfile(r'C:\CalendarTemplates\008.pdf') elif count == 1: print('009'); os.startfile(r'C:\CalendarTemplates\009.pdf') elif count == 2: print('010'); os.startfile(r'C:\CalendarTemplates\010.pdf') elif count == 3: print('011'); os.startfile(r'C:\CalendarTemplates\011.pdf') elif count == 4: print('012'); os.startfile(r'C:\CalendarTemplates\012.pdf') elif count == 5: print('013'); os.startfile(r'C:\CalendarTemplates\013.pdf') elif count == 6: print('014'); os.startfile(r'C:\CalendarTemplates\014.pdf') Page 1

HOWTO Perpetual Calendar

Embed Size (px)

DESCRIPTION

Make your own perpetual calendar by following these simple steps.Download Python 3.0 from http://www.python.org/download/releases/3.0/1. Copy and paste the python code from page 1 into Notepad and save it on your Desktop as pincal.py and choose All Files.2. Create a folder in Drive C and name it CalendarTemplates.3. Look for the 14 calendar templates from this same publisher (noeldtan). 4. Save all 14 C:\CalendarTemplates\xxx.pdf in the CalendarTemplates folder you created in Drive C.5. Make sure you save each template as xxx.pdf only without the pathname, for example, C:\CalendarTemplates\001.pdf should be saved as 001.pdf6. Run the program by clicking the pincal.py icon on your Desktop.OR You may request a copy of this program in CDROM. Send $5 to Paypal account [email protected] for S&H.

Citation preview

Page 1: HOWTO Perpetual Calendar

#pincal# pincal.py

import os

y = int(input("What year? (yyyy): "))f = 2*(13) + (3*(13+1)//5) + (y-1) + ((y-1)//4) - ((y-1)//100) + ((y-1)//400) + 2count = (f % 7)

if((y%4 == 0 and y%100 != 0) or y%400 == 0): if count == 0: print('001'); os.startfile(r'C:\CalendarTemplates\001.pdf') elif count == 1: print('002'); os.startfile(r'C:\CalendarTemplates\002.pdf') elif count == 2: print('003'); os.startfile(r'C:\CalendarTemplates\003.pdf') elif count == 3: print('004'); os.startfile(r'C:\CalendarTemplates\004.pdf') elif count == 4: print('005'); os.startfile(r'C:\CalendarTemplates\005.pdf') elif count == 5: print('006'); os.startfile(r'C:\CalendarTemplates\006.pdf') elif count == 6: print('007'); os.startfile(r'C:\CalendarTemplates\007.pdf')

else: if count == 0: print('008'); os.startfile(r'C:\CalendarTemplates\008.pdf') elif count == 1: print('009'); os.startfile(r'C:\CalendarTemplates\009.pdf') elif count == 2: print('010'); os.startfile(r'C:\CalendarTemplates\010.pdf') elif count == 3: print('011'); os.startfile(r'C:\CalendarTemplates\011.pdf') elif count == 4: print('012'); os.startfile(r'C:\CalendarTemplates\012.pdf') elif count == 5: print('013'); os.startfile(r'C:\CalendarTemplates\013.pdf') elif count == 6: print('014'); os.startfile(r'C:\CalendarTemplates\014.pdf')

Page 1

Page 2: HOWTO Perpetual Calendar

Instructions

When this python program is run, a console window appears and asks for you to input a year, eg 2009. It then opens a 12-month calendar pdf of the year that you input, in this case, C:\CalendarTemplates\012.pdf.

Here's what you need to do to make this work:

1. Copy and paste the entire code from page 1 into Notepad and save it on your Desktop as pincal.py and choose All Files.

2. Create a folder in Drive C and name it CalendarTemplates.

3. Look for the 14 calendar templates from this same publisher.

4. Save all 14 C:\CalendarTemplates\xxx.pdf in the new CalendarTemplates folder you created in Drive C.

5. Make sure you save each template as xxx.pdf without the pathname, for example, C:\CalendarTemplates\001.pdf should be saved as 001.pdf

Page 1